Skip to content

discord_channel

diapason.channels.discord_channel

DiscordChannel — native Discord Bot API adapter.

DiscordChannel

Bases: BaseChannel

Native Discord channel adapter using the Discord REST API.

Parameters

bot_token: Discord bot token. Falls back to DISCORD_BOT_TOKEN env var. bus: Optional event bus for publishing channel events.

connect()

Start listening for incoming messages via discord.py gateway.

disconnect()

Stop the listener thread.

list_channels()

Return available channel identifiers.

on_message(handler)

Register a callback for incoming messages.

send(channel, content, *, conversation_id='', metadata=None)

Send a message to a Discord channel via REST API.

status()

Return the current connection status.