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)
embed(title, **options)

Returns discord embed from given parameters with automatic footer and color options.

Parameters:
  • titlestr Title of the embed
  • urlOptional[str] url of the title
  • descriptionOptional[str] Description of the embed
  • fieldsOptional[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
  • imageOptional[str] Url of the embed image
  • thumbnailOptional[str] Url of the thumbnail image
  • authorOptional[Dict[str,str]] Author of the embed
Returns:

discord.Embed

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:
  • msgUnion[discord.Message,int] Message or message id of the message you want to add the reaction role functionality.
  • emojistr Emoji. If a unicode emoji use it, if a custom emoji use it’s name.
  • roleint Role id of the role you want to add to the emoji.