Alphakdeps.io is experimental and evolving — the registry and packages may change or reset.
Listenerkdeps asset

kdeps-listeners-discord_gateway

v1.0.0

Discord messages over the Gateway: runs the workflow once for each new message in a guild channel or a DM. The event is the message: input('content'), input('channel_id'), input('author').username. Messages from bots are left out. Reply with the discord_post component. Enable the Message Content intent for the bot. Requires DISCORD_BOT_TOKEN or the vault secret discord_bot_token.

set listeners / shelf workflow

LLM context: none - kdeps uses it without sending it to the model

Where it runs

Part of the listeners set, used in workflow and agent mode. Ready-made event sources for deploy.input.listen: a Telegram poll, Slack Socket Mode and the Discord Gateway, each one transport block in YAML.

  1. a workflow names a listener under deploy.input.listen
  2. the listener is read from the listeners set when kdeps run startslisteners/discord_gateway
  3. its transport (poll, websocket, ...) starts
  4. each event runs the workflow once

Loaded by: kdeps (agent loop), kdeps run, kdeps exec

In the code: kdeps (agent loop)listen.WakeAddrslisten.readListenerAsset

Install

A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.

kdeps install listeners/discord_gateway

Pin a version with kdeps install listeners/discord_gateway@<version>.

Contents

Discord messages over the Gateway: runs the workflow once for each new message in a guild channel or a DM. The event is the message: input('content'), input('channel_id'), input('author').username. Messages from bots are left out. Reply with the discord_post component. Enable the Message Content intent for the bot. Requires DISCORD_BOT_TOKEN or the vault secret discord_bot_token.

kdeps
>=3.6.0
websocket:
  env:
    TOKEN:
      - DISCORD_BOT_TOKEN
      - secret:discord_bot_token
  url: wss://gateway.discord.gg/?v=10&encoding=json
  heartbeat:
    send: '{"op":1,"d":{{or .state.seq "null"}}}'
  on:
    - when: "{{if eq (int .msg.op) 10}}y{{end}}"
      every: "{{.msg.d.heartbeat_interval}}ms"
      send: '{"op":2,"d":{"token":"{{.env.TOKEN}}","intents":37377,"properties":{"os":"linux","browser":"kdeps","device":"kdeps"}}}'
    - when: "{{.msg.s}}"
      set:
        seq: "{{.msg.s}}"
    - when: '{{if and (eq .msg.t "MESSAGE_CREATE") (not .msg.d.author.bot)}}y{{end}}'
      emit: "{{json .msg.d}}"
    - when: "{{if or (eq (int .msg.op) 7) (eq (int .msg.op) 9)}}y{{end}}"
      reconnect: true

Versions

VersionPublishedStatusSource
1.0.011/26/2026activeGitHub v1.0.0

Details

Author
kdeps
License
Apache-2.0
Latest Version
1.0.0
Published
11/26/2026

Tags

kdepslistener