pibot.cogs package

Submodules

pibot.cogs.admin module

Admin cog.

class pibot.cogs.admin.Admin(*args: Any, **kwargs: Any)

Bases: GroupCog

Admin commands.

clear = <discord.app_commands.commands.Command object>
command_channel = <discord.app_commands.commands.Command object>
mute = <discord.app_commands.commands.Command object>
prefix = <discord.app_commands.commands.Command object>
unmute = <discord.app_commands.commands.Command object>
async pibot.cogs.admin.setup(bot: Bot) None

Set up the cog.

pibot.cogs.devTools module

Development tools cog.

class pibot.cogs.devTools.DevTools(*args: Any, **kwargs: Any)

Bases: Cog

Development tools.

clear_commands = <discord.ext.commands.core.Command object>
clear_global_commands = <discord.ext.commands.core.Command object>
async cog_check(ctx)

Allow only the bot owner to use dev tools commands.

list_commands = <discord.ext.commands.core.Command object>
sync_commands = <discord.ext.commands.core.Command object>
async pibot.cogs.devTools.setup(bot: Bot) None

Set up the cog when ENABLE_DEV_TOOLS is enabled.

pibot.cogs.error_handler module

Handles errors in the bot.

class pibot.cogs.error_handler.ExceptionHandler(*args: Any, **kwargs: Any)

Bases: Cog

Error handler.

async on_app_command_error(interaction: Interaction, error: AppCommandError) None

Handle app command errors.

Parameters:
  • interaction – The interaction of the slash command.

  • error – The error that occurred.

async on_command_error(ctx: Context, error: CommandError) None

Handle prefix command errors.

async pibot.cogs.error_handler.send_app_command_error_message(interaction: Interaction, description: str, error: AppCommandError)

Send a final error message.

async pibot.cogs.error_handler.send_command_error_message(ctx: Context, description: str, error: CommandError)

Send a final prefix command error message.

async pibot.cogs.error_handler.setup(bot: Bot) None

Load the cog.

pibot.cogs.general module

General cog.

class pibot.cogs.general.General(*args: Any, **kwargs: Any)

Bases: Cog

General commands.

countdown = <discord.app_commands.commands.Command object>
ping = <discord.app_commands.commands.Command object>
version = <discord.app_commands.commands.Command object>
async pibot.cogs.general.setup(bot: Bot) None

Set up the cog.

pibot.cogs.translations module

Translations cog for PiBot.

class pibot.cogs.translations.Translations(*args: Any, **kwargs: Any)

Bases: Cog

Translation commands.

get_languages = <discord.app_commands.commands.Command object>
language_dict: dict[str, str] = {'🇦🇪': 'AR', '🇧🇬': 'BG', '🇧🇷': 'PT-BR', '🇨🇳': 'ZH-HANS', '🇨🇿': 'CS', '🇩🇪': 'DE', '🇩🇰': 'DA', '🇪🇪': 'ET', '🇪🇸': 'ES', '🇫🇮': 'FI', '🇫🇷': 'FR', '🇬🇧': 'EN-GB', '🇬🇷': 'EL', '🇭🇺': 'HU', '🇮🇩': 'ID', '🇮🇹': 'IT', '🇯🇵': 'JA', '🇰🇷': 'KO', '🇱🇹': 'LT', '🇱🇻': 'LV', '🇳🇱': 'NL', '🇳🇴': 'NB', '🇵🇱': 'PL', '🇵🇹': 'PT-PT', '🇷🇴': 'RO', '🇷🇺': 'RU', '🇸🇪': 'SV', '🇸🇮': 'SL', '🇸🇰': 'SK', '🇹🇷': 'TR', '🇹🇼': 'ZH-HANT', '🇺🇦': 'UK', '🇺🇸': 'EN-US'}
async on_raw_reaction_add(payload: RawReactionActionEvent)

Handle reaction add events.

Parameters:

payload – The payload of the reaction.

async send_translation(channel_id: int, message_author_id: int, message_id: int, target_lang: str, target_lang_emoji: str | None = None) None

Send the translation to the channel.

Parameters:
  • channel_id – The ID of the channel.

  • message_author_id – The ID of the message author.

  • message_id – The ID of the message.

  • target_lang – The target language to translate to.

  • target_lang_emoji – The emoji of the target language.

async pibot.cogs.translations.setup(bot: Bot) None

Set up the cog.

Module contents

PiBot cogs package.