BaseBot
A subclass of discord.ext.commands.Bot. This bot implement some manage commands errors.
Parameters
Parameter
Type
Description
Required
Default
token
str
✔️
*args
*Any
✔️
color
Union[discord.Colour, Tuple[R, G, B]]
The main color of Bot (for embeds).
✔️
color_error
Union[discord.Colour, Tuple[R, G, B]]
The color for errors messages (embeds)
✔️
send_errors
bool
If True, the bot send a error message to owner of application for all commands errors not manage
❌
False
permissions
int
❌
0
logger
logging.Logger
A logger to use in the application. If None
, a default logger in debug level with the class name of bot is used.
❌
None
**kwargs
**Any
❌
Attributes
Attributes of discord.ext.commands.Bot
+
Name
Type
Description
token
str
color
Union[discord.Colour, Tuple[R, G, B]]
The main color of Bot (for embeds).
color_error
Union[discord.Colour, Tuple[R, G, B]]
The color for errors messages (embeds)
send_errors
bool
If True, the bot send a error message to owner of application for all commands errors not manage
permissions
int
logger
logging.Logger
A logger to use in the application.
app_info
avatar_url
str
Avatar URL of bot loaded in on_ready
event
Methods
Methods of discord.ext.commands.Bot
+
messages_on_ready
: messages to display on an on_ready event.Default: display informations on bot (name and id)
async init_on_ready
: asynchrone method to initialize attributes on an on_ready event.Default: initialize
app_info
andavatar_url
attributes
get_invitation
: method to get invitation URL with permissions define bypermissions
attributeParameters
permissions
: int =None
: permission to use, if None, use thepermissions
attribute
Returns
invitation_url
: str : The invitation URL of bot
Methods overwrite
async on_command_error
: manage some commands errors :
Error
Do
commands.errors.CommandNotFound
Ignore this exception
commands.errors.BadArgument
Send an error message to user
MissingRequiredArgument
Send an error message to user
MissingPermissions
Send an error message to user with required permissions
MissingRoles
Send an error message to user with roles required
BotMissingPermissions
Send an error message to user with permissions required
BotMissingRole
Send an error message to user with roles required
Last updated
Was this helpful?