Add Discord communication channel adapter#193
Open
machieke wants to merge 4 commits into
Open
Conversation
Implement RESUME on gateway reconnect (op 7) and resumable invalid session (op 9), tracking session_id/resume_gateway_url/sequence so messages dropped during transient disconnects are replayed instead of lost. Cap back-to-back resume attempts to avoid IDENTIFY thrash and fall back to a fresh identify on the existing capped backoff. Detect zombied connections via missing HEARTBEAT_ACK (op 11) and force a reconnect. Centralize the default gateway intents constant. Wire the discord adapter unit test into run_mandatory and expand coverage: auth-enabled gating, display-name fallbacks, send chunking, and the resume payload. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Discord as a supported
commchannelalongside IRC, Telegram, Slack, and Mattermost.This PR includes:
channels/discord.pyadapter using Discord Gateway for inbound messages and HTTP API for outbound messagescommchannel=discordwiring in MeTTa channel dispatchDC_BOT_TOKEN,DC_CHANNEL_ID,DC_GATEWAY_INTENTS, and optional API/Gateway overrides4014 disallowed intentsTesting
Ran:
git diff --checkpython3 -m pytest Autotests/mock_discord/test_discord_adapter.py Autotests/test_policy_best_effort.py -qpython3 -m py_compile channels/discord.py profile/policy.pybash -n scripts/omegaclaw entrypoint.shNotes
Discord server-channel usage with full text commands requires enabling Message Content Intent in the Discord Developer Portal. Without that privileged intent, users can set
DC_GATEWAY_INTENTS=4609and interact via DMs or by mentioning the bot at the start of each server-channel message.