API Reference

Bot

The default order in which everything is called and what methods call what:

  • on_raw_reaction_add(payload)

    • process_raw_reaction_commands(payload)

      • get_raw_reaction_context(payload)

        • _early_invoke
          checks if reaction is a command that can be invoked without prefix. If
          invoke_without_prefix is True, returns a valid ctx here instead of continuing.
        • reaction_before_processing(ctx)

        • _wait_for_emoji_stream
          uses wait_for for reactions and tries to find a command from them.
        • reaction_after_processing(ctx)
          starts as a task
      • runs checks, before invokes, arg conversion, and all the normal stuff.

See also

process_reaction_commands() and get_reaction_context() for invoking from on_reaction_add() instead of raw methods.

ReactionBotMixin

Can use this to add reaction commands for your own bot subclass. Just be sure nothing conflicts.

class OtherSubclassedBot(commands.Bot):
    # stuff here

class SubclassedBot(ReactionBotMixin, OtherSubclassedBot):
    pass

Note

Probably use/subclass ReactionBot or AutoShardedReactionBot instead.

ReactionBot

AutoShardedReactionBot

Woah look at you. Imagine having a bot big enough to use AutoShardedReactionBot.

ReactionCommand

ReactionCommand classes and other related stuff. Mostly behave like normal commands. Only big difference is emojis and altered _parse_arguments for argument parsing.

Decorators

Decorators for adding commands in cogs.

Command Classes

You can combine these with your own command/group subclasses just like ReactionBotMixin. Same as above, be careful about any conflicts.

ReactionCommand

ReactionGroup

ReactionContext

There’s a lot of weird crap that goes on here if using raw methods. A ProxyBase is used if anything from payload cannot be resolved to a matching object from cache.

Ex: A ProxyMember or ProxyUser may be used instead of discord.Member or discord.User if get_member() or get_user() return None and payload.member is None.

ReactionHelp

Even comes with a help command. If you want to customize it there’s not really a simple way so you’re basically subclassing help.

Misc things

Things that were small enough and didn’t want to make a new page

Util functions

discord.ext.reactioncommands.utils.scrub_emojis(emoji)

Uses regex to remove skin color modifiers and gender modifiers.

Ex: 👍🏿/👍🏾/👍🏽/👍🏼/👍🏻 –> 👍

🧙‍♂️/🧙‍♀️ –> 🧙

Parameters

emoji (str) – text/emojis to remove modifiers from

Returns

the input text scrubbed of modifiers

Return type

str

Error

Just one for now