Poll¶
Represents a Poll menu.
- Parameters
ctx (
Context
) – A reference to the command context.
Utility method to add new fields to your next page automatically.
Utility method to build your entire results page automatically.
The entry point to a new Poll instance; starts the main menu loop. Manages gathering user input, basic validation, sending messages, and cancellation requests.
Sets various callback attributes on the menu so users can hook into specific events. See https://dpymenus.com/lifecycle for the full list of events and hook structure.
- Parameters
- Return type
Adds a list of pages to a menu, setting their index based on the position in the list. Returns itself for fluent-style chaining.
- Parameters
pages (
List
[ForwardRef
]) – A list of pages to display; ordered from first to last in linear menus.template (Template) – An optional
Template
to define a menu style.
- Return type
Checks if the reaction the user pressed is equal to the argument.
- Parameters
button (Button) – The reaction to compare against user input.
- Return type
Gracefully exits out of the menu, performing necessary cleanup of sessions, reactions, and messages.
Disables the Reply feature on Discord from being used with this menu. Overrides the global settings. Returns itself for fluent-style chaining.
- Return type
Transitions to a specific page.
Clears all remaining tasks in the task queue.
Returns the last visited page index.
- Return type
Transitions to the next page.
Prevents message cleanup from running when a menu closes. Returns itself for fluent-style chaining.
- Return type
Transitions to the previous page.
Updates the output message if it can be edited, otherwise sends a new message.
- Parameters
page (PageType) – A
PageType
to send to Discord.
Overrides the default check method for user responses. Returns itself for fluent-style chaining.
Sets a dictionary up for persistent state data. Returns itself for fluent-style chaining.
Sets the message destination for the menu. Returns itself for fluent-style chaining.
- Parameters
dest (
Union
[User
,TextChannel
]) – Where, in Discord, to send and display the menu.- Return type
Sets the initial page of the menu when opened based on a pages index in the add_pages list. Defaults to 0.
Sets the timeout on a menu. Returns itself for fluent-style chaining.
Persists user command invocation messages in the chat instead of deleting them after execution. Returns itself for fluent-style chaining.
- Return type
Transitions to the first page.
Transitions to the last page.