Cogs

The cogs of this package implement some basics and utils commands: help commands, utils commands for the application's owner.

Help

circle-info

A cogarrow-up-right which implement help commands and methods to build the help message.

import discord
from discord_slash import SlashCommand
from baseDiscord import BaseBot, Help

mybot = BaseBot("my token", prefix="!", color=discord.Colour.blue(), color_error=discord.Colour.red())
slash = SlashCommand(mybot)

# Add cogs
Help.setup(bot)

Parameters

Help.__init__(self, bot: commands.Bot, max_cmd_by_page: int = 8)

Parameter

Type

Description

Required

Default

bot

The Bot instance which use the cog

✔️

max_cmd_by_page

int

The maximum of commands by help page. Used for the global help command.

8

Attributes

Attributes of discord.ext.commands.Cogarrow-up-right +

Name

Type

Description

bot

The Bot instance which use the cog

max_cmd_by_page

int

The maximum of commands by help page. Used for the global help command.

Methods

Methods of Cog +

circle-info

The method base_embedcan be use to create an Embedarrow-up-right with avatar of bot in thumbnail and the author of command.

  • _command_base : a method to create a base help for a command. Used for the global help command.

  • _command_usage : a method to create an usage message for a command

  • _command_aliases : a method to create aliases message for a command.

  • _command_help_fmt : method to format the help message for a command. This method join the result of _command_base, _command_usage and _command_aliases methods.

circle-info

⬆️ These methods can be overwrite to customize the help message of a command.

circle-info

To customize the first page of help command. You can overwrite the first_page method. This method must returns an Embedarrow-up-right.

circle-info

To customize the structure of pages for the help command. You can overwrite the method. This method must returns a list of Embedarrow-up-right.

Commands

circle-exclamation

Slash Commands

  • help

    • all : Show a help on all commands in an embed multi pages. This commands use first_page and commands_pages to build pages.

    • command :Get help for a scpecific command.

    • category : Get help for a category of commands

circle-info

Commands which have the attribute hidden = True aren't displayed.

circle-exclamation
triangle-exclamation

Owner

circle-info

A cogarrow-up-right which implement utils commands for the application's owner.

Parameters

Parameter

Type

Description

Required

Default

bot

The Bot instance which use the cog

✔️

Attributes

Attributes of discord.ext.commands.Cogarrow-up-right +

Name

Type

Description

bot

The Bot instance which use the cog

Methods

Commands

  • stopBot : A command to disconnect the bot.

circle-info

All commands of this Cogarrow-up-right are created with attribute hidden=True

Slash Commands

circle-exclamation

Last updated