frontend.src.poll_commands.components.modals

This module contains all the modals (pop-ups) used for managing questions on a poll.

Module Contents

Classes

MCPollModal

Class for representing the modal used for creating a new question to a poll,

RemoveModal

Class for representing the modal used for deleting a question from the poll.

class frontend.src.poll_commands.components.modals.MCPollModal(*children: discord.ui.InputText, title: str)

Bases: discord.ui.Modal

Class for representing the modal used for creating a new question to a poll, with a set of comma-separated options.

async callback(interaction: discord.Interaction)

Callback function whenever the user submits their input for the modal for creating the poll question. Does some validation of the option field before embedding the question into the poll.

Args:

interaction: The submission interaction from the user

class frontend.src.poll_commands.components.modals.RemoveModal(*children: discord.ui.InputText, title: str, question_list)

Bases: discord.ui.Modal

Class for representing the modal used for deleting a question from the poll.

async callback(interaction: discord.Interaction)

Callback for when the user submits their input for the modal. Removes the question from the poll if it was there and states it was successful in doing so, but reports back stating otherwise.

Args:

interaction: The submission interaction from the user