bundle.discord.bot

Core Discord bot implementation.

Attributes

Classes

BotConfig

Configuration for the Discord bot.

Bot

TheBundle Discord bot.

Functions

to_discord_channel_name(→ str)

Convert a display name into a Discord-safe text channel name.

run_bot(→ None)

Create and run the Discord bot.

Module Contents

bundle.discord.bot.log
bundle.discord.bot.DEFAULT_BOT_NAME = 'Bundle Bot'
bundle.discord.bot.to_discord_channel_name(value: str) str

Convert a display name into a Discord-safe text channel name.

class bundle.discord.bot.BotConfig(/, **data: Any)

Bases: bundle.core.data.Data

Configuration for the Discord bot.

token: str
bot_name: str = 'Bundle Bot'
command_prefix: str = '!'
intents_message_content: bool = True
intents_members: bool = True
property channel_name: str
class bundle.discord.bot.Bot(config: BotConfig)

Bases: discord.ext.commands.Bot

TheBundle Discord bot.

config
property brand_name: str
property brand_avatar_url: str | None
property embeds: bundle.discord.embeds.EmbedFactory

Embed factory pre-configured with the bot’s brand identity.

async bot_channel(guild: discord.Guild) discord.TextChannel

Get or create the dedicated bot channel for a guild.

async sync_guild_identity(guild: discord.Guild) None

Best-effort sync of the bot nickname to the configured brand name.

async on_ready() None
async on_guild_join(guild: discord.Guild) None

Sync slash commands when the bot joins a new guild.

async setup_hook() None

Load all cogs.

async bundle.discord.bot.run_bot(config: BotConfig) None

Create and run the Discord bot.