Add slash commands, event-driven bots, and webhooks to your ɳChat channels. Write bot logic in any language — bots talk to nSelf over a simple HTTP callback interface.
Bot logic runs wherever you host it — on your VPS as a nself custom service, or anywhere with a public HTTPS endpoint.
nself license set nself_pro_...
nself plugin install bots
nself build
nself startnself-bots provides a bot registry where each bot declares its slash commands and event subscriptions. When a user types a slash command in chat, the plugin routes the payload to the bot's callback URL and posts the response back into the channel. Bots can also subscribe to channel events (message created, member joined, reaction added) and react asynchronously.
Bots are registered via the admin API or the nself-admin UI. Each bot gets an API token that it uses to call back into nself-chat on behalf of itself — posting messages, uploading files, or updating channel metadata. Tokens are scoped and can be revoked per bot without affecting others.
Built-in bot templates include a moderation bot (acts on flagged content from nself-moderation), a GitHub notification bot (posts PR and issue events), and an echo test bot for development. Custom bots can be any HTTP server.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | Postgres connection string (auto-set by nself) |
BOTS_CALLBACK_TIMEOUT_MS | No | Max time to wait for bot callback response. Default: 5000 |
BOTS_MAX_RESPONSE_BYTES | No | Max bot response payload size. Default: 65536 |
BOTS_SIGNING_SECRET | No | HMAC secret used to sign outbound payloads so bots can verify origin |
| Endpoint | Method | Description |
|---|---|---|
/bots | GET / POST | List registered bots or register a new bot |
/bots/:id | GET / PUT / DELETE | Get, update, or remove a bot registration |
/bots/:id/token/rotate | POST | Rotate the bot's API token |
/bots/incoming | POST | Incoming webhook endpoint — bots post messages back here |
/health | GET | Plugin health check |
| Table | Purpose |
|---|---|
np_bots | Bot registry: name, callback URL, commands, subscriptions, token hash |
np_bot_invocations | Invocation log: command, user, channel, response status, latency |
| Event | Payload |
|---|---|
bot.invoked | Bot ID, command, user ID, channel ID, response latency |
bot.error | Bot ID, command, error type (timeout/http-error/invalid-response) |
After installing nself-bots alongside nself-chat, register a bot via POST /bots with your callback URL and the slash commands it handles. The plugin routes /your-command messages directly to your server. Bots post replies back through POST /bots/incoming using their token, and nself-chat delivers the reply as a regular channel message attributed to the bot.
Slash command not routing: Verify the command is declared in the bot's commands array during registration. Commands must start with / and contain no spaces.
Callback timing out: Increase BOTS_CALLBACK_TIMEOUT_MS or move long-running work async — respond immediately with a 202 Accepted and post the result later via /bots/incoming.
Port: 3103 | Bundle: ɳChat ($0.99/mo) or ɳSelf+ ($3.99/mo) | Last Updated: May 2026 | Plugin Version 1.0.13