BaseBot
A subclass of discord.ext.commands.Bot. This bot implement some manage commands errors.
Parameters
Parameter | Type | Description | Required | Default |
| str | The Token of bot | ✔️ | |
| *Any | Positional arguments to passed to the constructor of | ✔️ | |
| Union[discord.Colour, Tuple[R, G, B]] | The main color of Bot (for embeds). | ✔️ | |
| Union[discord.Colour, Tuple[R, G, B]] | The color for errors messages (embeds) | ✔️ | |
| bool | If True, the bot send a error message to owner of application for all commands errors not manage | ❌ |
|
| int | The permissions of Bot (use for invitation URL) | ❌ |
|
| logging.Logger | A logger to use in the application. If | ❌ |
|
| **Any | Keywords arguments to passed to the constructor of | ❌ |
Attributes
Attributes of discord.ext.commands.Bot
+
Name | Type | Description |
token | str | The Token of bot |
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 | The permissions of Bot (use for invitation URL) |
logger | logging.Logger | A logger to use in the application. |
app_info | AppInfo instance loaded in | |
avatar_url | str | Avatar URL of bot loaded in |
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 |
| Ignore this exception |
| Send an error message to user |
| Send an error message to user |
| Send an error message to user with required permissions |
| Send an error message to user with roles required |
| Send an error message to user with permissions required |
| Send an error message to user with roles required |
Last updated