Main¶
-
class
main.
Client
(*, loop=None, **options)¶ Discord client class inherited from discord.Client. This documentation covers only the changes. For the inherited functions please head to the discord.py documentation
Parameters: - embedFooter – Optional[
dict
] The footer of embeds. - embedColor – Optional[
tuple[int,int,int]
] The color of embeds. - botName – Optional[
str
] The name of the bot. - commandPrefix – Optional[
str
] The prefix of all commands. - useDefaultHelp – Optional[
bool
] Whether to use the default help. Default: True - isHelpInline – Optional[
bool
] If using the default help. Wheter it is inline or not. Default: True - logging – Optional[
bool
] If message logging is enabled. Default: False - caseSensitiveCommands – Optional[
bool
] If commands are case sensitive. Default: True - sendExceptions – Optional[
bool
] If sending exceptions to discord is enabled. Default: True
-
command
(commandName, **options)¶ Wrapper fuction for making commands.
Parameters: - worksOnlyInGuilds – Optional[
List[int]
] List of guild where the command will work. List of guild where the command will work. - worksOnlyInChannels – Optional[
List[int]
] List of channels where the command will work. If not provided will for in all. - doesntWorkInGuilds – Optional[
List[int]
] List of guilds where the command wont work. List of guild where the command will work. - doesntWorkInChannels – Optional[
List[int]
] List of guilds where the command wont work. List of guild where the command will work.
@client.command(“command”) def command(message):
print(message.content)- worksOnlyInGuilds – Optional[
-
embed
(title, **options)¶ Returns discord embed from given parameters with automatic footer and color options.
Parameters: - title –
str
Title of the embed - url –
Optional[str]
url of the title - description –
Optional[str]
Description of the embed - fields –
Optional[List[Tuple[str,str,Optional[bool]]]]
Fields of the embed. A tuple with item 1 being the name of the field, item 2 the value and item 3 weather is inline or not, item 3 is optional - image –
Optional[str]
Url of the embed image - thumbnail –
Optional[str]
Url of the thumbnail image - author –
Optional[Dict[str,str]]
Author of the embed
Returns: discord.Embed
- title –
-
event
(coro)¶ A decorator that registers an event to listen to.
You can find more info about the events on the documentation below.
The events must be a coroutine, if not,
TypeError
is raised.@client.event async def on_ready(): print('Ready!')
- TypeError
- The coroutine passed is not actually a coroutine.
-
logCommand
(function)¶ Wrapper fuction for making a logging function. Like
@client.logCommand def log(command, message, time, state, exception): print(message.content)
-
logMessage
(function)¶ Wrapper fuction for making a logging function. Like
@client.logMessage def log(message): print(message.content)
-
reactionRole
(msg, emoji, role)¶ Function to add reaction role functions to a message.
Parameters: - msg –
Union[discord.Message,int]
Message or message id of the message you want to add the reaction role functionality. - emoji –
str
Emoji. If a unicode emoji use it, if a custom emoji use it’s name. - role –
int
Role id of the role you want to add to the emoji.
- msg –
- embedFooter – Optional[