discordapi.command
Module Contents
Classes
Handler to handle methods with defined methods. |
|
Handler to handle methods with defined methods. |
- exception discordapi.command.CommandError(command, title, message)
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class discordapi.command.CommandManager(client=None)
- _set_client(self, client)
- execute_cmd(self, cmdinput, message)
- class discordapi.command.EmbedCommandManager(client=None)
Bases:
CommandManager
- set_color(self, color)
- execute_cmd(self, cmdinput, message)
- class discordapi.command.CommandEventHandler(manager, prefix)
Bases:
discordapi.handler.MethodEventHandler
Handler to handle methods with defined methods.
This handler calls .on_{lowercased event type} method when event issues. e.g. self.on_message_create method gets called when MESSAGE_CREATE fires. If the corresponding method has not defined, It does nothing.
The arguments handlers will receive is the same as .handle method.
Since this runs on a main client thread, running a time-consuming job will block other events from reaching the client, stopping the bot from functioning. Please start another thread for those jobs.
No method other than .handle comes predefined, You have to either inherit this method or assign functions as attributes to use this.
- _set_manager(self, manager)
- on_message_create(self, message)
- class discordapi.command.ThreadedCommandEventHandler(manager, prefix)
Bases:
CommandEventHandler,discordapi.handler.ThreadedMethodEventHandler
Handler to handle methods with defined methods.
This handler calls .on_{lowercased event type} method when event issues. e.g. self.on_message_create method gets called when MESSAGE_CREATE fires. If the corresponding method has not defined, It does nothing.
The arguments handlers will receive is the same as .handle method.
Since this runs on a main client thread, running a time-consuming job will block other events from reaching the client, stopping the bot from functioning. Please start another thread for those jobs.
No method other than .handle comes predefined, You have to either inherit this method or assign functions as attributes to use this.