Discord engine for the Axion conversation framework.
Sends messages to Discord via the Discord REST API (requests).
Inherits from ObjConversationEngine.ConversationInterface.
Config section: discord
| Key | Description |
|---|---|
bottoken |
Discord bot token |
channel_id |
Default channel for outbound messages |
Methods:
_init_client() — loads credentials from configtransmit_message(message, channel_id="") — POSTs to the Discord REST API; truncates at 2 000 charsdisplay_context(opts) — sends bold conversation/contact/page header plus filled input fieldsdisplay_options(opts) — sends backtick-formatted commands and pencil-prefixed prompts; returns (first_key, first_prompt)Runs the discord.py event loop to receive messages from Discord.
Methods:
run() — starts discord.Client via asyncio.run(); calls ObjConversation.read_conversation() on each inbound messagediscord library via HAS_DISCORD flagconfig.yaml:discord:
bottoken: ""
channel_id: ""
bot scope and Send Messages + Read Message History permissions.