Skip to content

Interaction events (e.g. slash commands) not handled when using Discord adapter in gateway only mode #343

@yyamanoi1222

Description

@yyamanoi1222

Bug Description

When running the Discord adapter in gateway-only mode (without an interaction endpoint), interaction events such as slash commands are never handled. The InteractionCreate event is not listened for inside the setupLegacyGatewayHandlers method, making it impossible to respond to slash commands in long-running (resident) bot applications that do not use an HTTP interaction endpoint.

Steps to Reproduce

  1. Set up a Discord bot using the Chat SDK's Discord adapter in gateway-only mode (no interaction endpoint configured).
  2. Register a slash command with the Discord API.
  3. Invoke the slash command in Discord.
  4. Observe that no handler is triggered and the interaction goes unhandled.

Expected Behavior

The InteractionCreate event should be received and dispatched to the appropriate handler when the Discord adapter is running in gateway mode, allowing slash commands and other interactions to be handled without requiring an HTTP interaction endpoint.

Actual Behavior

The InteractionCreate event is never emitted or handled because setupLegacyGatewayHandlers does not register a listener for it. As a result, slash commands silently fail with no response.

Code Sample

Chat SDK Version

4.24.0

Node.js Version

22.21.1

Platform Adapter

Discord

Operating System

Linux

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions