bundle.discord.bot ================== .. py:module:: bundle.discord.bot .. autoapi-nested-parse:: Core Discord bot implementation. Attributes ---------- .. autoapisummary:: bundle.discord.bot.log bundle.discord.bot.DEFAULT_BOT_NAME Classes ------- .. autoapisummary:: bundle.discord.bot.BotConfig bundle.discord.bot.Bot Functions --------- .. autoapisummary:: bundle.discord.bot.to_discord_channel_name bundle.discord.bot.run_bot Module Contents --------------- .. py:data:: log .. py:data:: DEFAULT_BOT_NAME :value: 'Bundle Bot' .. py:function:: to_discord_channel_name(value: str) -> str Convert a display name into a Discord-safe text channel name. .. py:class:: BotConfig(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Configuration for the Discord bot. .. py:attribute:: token :type: str .. py:attribute:: bot_name :type: str :value: 'Bundle Bot' .. py:attribute:: command_prefix :type: str :value: '!' .. py:attribute:: intents_message_content :type: bool :value: True .. py:attribute:: intents_members :type: bool :value: True .. py:property:: channel_name :type: str .. py:class:: Bot(config: BotConfig) Bases: :py:obj:`discord.ext.commands.Bot` TheBundle Discord bot. .. py:attribute:: config .. py:property:: brand_name :type: str .. py:property:: brand_avatar_url :type: str | None .. py:property:: embeds :type: bundle.discord.embeds.EmbedFactory Embed factory pre-configured with the bot's brand identity. .. py:method:: bot_channel(guild: discord.Guild) -> discord.TextChannel :async: Get or create the dedicated bot channel for a guild. .. py:method:: sync_guild_identity(guild: discord.Guild) -> None :async: Best-effort sync of the bot nickname to the configured brand name. .. py:method:: on_ready() -> None :async: .. py:method:: on_guild_join(guild: discord.Guild) -> None :async: Sync slash commands when the bot joins a new guild. .. py:method:: setup_hook() -> None :async: Load all cogs. .. py:function:: run_bot(config: BotConfig) -> None :async: Create and run the Discord bot.