discord-eprompt¶
-
class
discord_eprompt.
ReactPromptPreset
¶ Common sets of choices for prompts.
A preset is defined as a dictionary with the keys being emoji to react with, and the values being a string representation of the response.
-
discord_eprompt.
react_prompt_response
(bot: discord.ext.commands.bot.Bot, user: Union[discord.user.User, discord.member.Member], message: discord.message.Message, preset: discord_eprompt.ReactPromptPreset = None, reacts: Dict[str, str] = None, persist_message: bool = False)¶ Use a message as a reaction prompt and get the user’s choice.
The bot will add the given reactions to the message and disallow anyone other than the specified user from reacting. This will return a string representation of the user’s choice when the user clicks on a reaction.
Parameters: - bot – The bot that will react to the message with the choices for the user.
- user – The user who is allowed to react.
- message – The message to use as the prompt.
- preset – The list of choices, defined as a preset by the library.
- reacts – The list of choices, defined as a dictionary in which the keys are the emoji to use as the reaction, and the values are what will be returned when that respective choice is selected.
- persist_message – Whether or not to keep the message after the user reacts to it. The default behavior is to delete the message upon user input.
Returns: The user’s choice.