Skip to content

dsbot-channel

Verified

dsbot-channel Β· v0.3.0 Β· MIT

A message gateway for ds-bot: events from several external platforms reach one bot, and answers go back to the conversation they came from

Install

dsh plugin add dsbot-channel

Confirm the layer applied with dsh --profile default --dump-config β€” see the install guide.

Source

Tags

Creators

Readme

dsbot-channel

English | δΈ­ζ–‡

DSH DS-Bot

A message gateway for ds-bot: events from several external platforms reach one bot, and answers go back to the conversation they came from.

Requirements

  • Node.js ^20.19.0 or >=22.12.0, and pnpm
  • The host services: credentials (adapter secrets), session controller (turns), tools (tool mode). Session persistence is used when the host provides it: the log is flushed after each delivered reply.

Tested against DS-Bot 0.2.x; later releases are not guaranteed.

Install

From the dsh UI, or from a terminal:

dsh plugin --profile ds-bot add dsbot-channel

From source: pnpm install, then pnpm build.

Configure

Mount it in a profile through its bundle patch. It ships enabled with no adapters, so it stays idle until a profile declares one.

config:
  adapters:
    - kind: p2p
      channel: p2p:self
      instance: self
      botName: self-bot
      transport:
        listen: { host: 127.0.0.1, port: 7123 }
        peers:
          - instance: peer-a
            secret: PEER_A_REFERENCE
    - kind: onebot
      channel: onebot:self
      instance: onebot
      botName: self-bot
      transport:
        listen: { host: 127.0.0.1, port: 7331 }
        api: { url: "http://127.0.0.1:3000" }
        accessToken: ONEBOT_TOKEN
    - kind: onebot
      channel: onebot:ws
      instance: onebot-ws
      botName: self-bot
      transport:
        protocol: ws-reverse
        listen: { host: 127.0.0.1, port: 7332, path: /onebot/ws }
        accessToken: ONEBOT_TOKEN

channel, instance, botName and transport are required, and channel must be unique. kind defaults to p2p; onebot is the other built-in, and a third-party transport registers as x-[a-z0-9-]+, at most 32 characters. secret and accessToken are reference names in the host credentials service, not the secrets themselves. Paths in a profile are read as POSIX paths; Windows is not supported.

An OneBot adapter speaks one protocol: transport.protocol is http (the default), ws-forward or ws-reverse. A field that belongs to another protocol is refused when the profile loads. Each adapter is one link: an implementation reached over one protocol gets one OneBot adapter, not two.

The impression library is off until a top-level impressions block names an absolute dir. It keeps short notes about the person a turn answers or about its group; impression_put, impression_get and impression_forget read and write them.

Field Default Meaning
policy.requireMention false groups must mention
policy.groupBots whenMentioned bot messages in groups
policy.budget.capacity off points per window
policy.budget.hardLimit 1 ratio that refuses
reply.default auto how a turn answers
reply.byScope β€” mode per scope
reply.rules β€” ordered overrides
turn.coalesceMs 0 merge window
turn.maxBatch 10 messages per batch
turn.maxChars 8000 batch budget
turn.context.messages 0 earlier messages
turn.context.chars 2000 context budget
impressions.dir off notes root
transport.protocol http OneBot: how it connects
transport.heartbeat off OneBot on a socket: liveness
transport.reconnect backoff OneBot ws-forward: backoff, false to stay offline
transport.history.group false OneBot: group history
transport.history.private false OneBot: private history
transport.fileFromUrl false OneBot: file from a url
status true status route

License

MIT. See LICENSE.