Skip to content

Discord: Implement Gateway WebSocket for receiving messages #45

@mihaelamj

Description

@mihaelamj

Problem

DiscordChannel can send messages and handle slash command interactions via REST API, but cannot receive normal chat messages. The Gateway WebSocket connection is not implemented.

File: Packages/Sources/DiscordChannel/DiscordChannel.swift:55

// Full implementation: connect to Gateway WebSocket for events

What's needed

  • Connect to Discord Gateway WebSocket (wss://gateway.discord.gg)
  • Implement heartbeat/identify handshake
  • Listen for MESSAGE_CREATE events
  • Route incoming messages through the onMessage handler

Current state

  • ✅ REST API send (/channels/{id}/messages)
  • ✅ Interaction handler (slash commands, buttons)
  • ✅ Bot token validation (/users/@me)
  • ❌ Gateway WebSocket connection
  • ❌ Normal message receiving

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions