sidequest_bot.bot ================= .. py:module:: sidequest_bot.bot .. autoapi-nested-parse:: Bot class: wiring for the API client, config cache, plugins, and slash-command errors. Attributes ---------- .. autoapisummary:: sidequest_bot.bot.logger Classes ------- .. autoapisummary:: sidequest_bot.bot.SideQuestBot sidequest_bot.bot.SideQuestTree Functions --------- .. autoapisummary:: sidequest_bot.bot.build_intents sidequest_bot.bot.create_bot Module Contents --------------- .. py:class:: SideQuestBot(*, api: sidequest_bot.api_client.SideQuestAPI, dev_guild_id: int | None = None) Bases: :py:obj:`discord.ext.commands.Bot` Slash-command bot. ``api`` and ``configs`` are shared by every plugin. .. py:method:: close() -> None :async: Close the API client along with the gateway connection. .. py:method:: on_ready() -> None :async: Log the identity we connected as. .. py:method:: send_log(guild: discord.Guild, embed: discord.Embed) -> discord.Message | None :async: Post ``embed`` to the guild's configured log channel. No-op if unset, missing, or not writable. .. py:method:: setup_hook() -> None :async: Load every plugin module, then sync slash commands. .. py:attribute:: api .. py:attribute:: configs .. py:attribute:: dev_guild_id :value: None .. py:class:: SideQuestTree Bases: :py:obj:`discord.app_commands.CommandTree`\ [\ :py:obj:`SideQuestBot`\ ] Command tree that tells users what went wrong (ephemerally) instead of failing silently. .. py:method:: on_error(interaction: discord.Interaction[SideQuestBot], error: discord.app_commands.AppCommandError, /) -> None :async: Map known failures to a friendly message; log everything unexpected. .. py:function:: build_intents() -> discord.Intents Default intents plus the privileged ones the plugins need. ``members``: welcome, auto-role, member logs. ``message_content``: automod filters and logging message text. Both must also be enabled for the application in the Discord Developer Portal. .. py:function:: create_bot(discord_settings: sidequest_common.settings.DiscordSettings, api_settings: sidequest_common.settings.APISettings) -> SideQuestBot Bot wired to the API described by ``api_settings``. .. py:data:: logger