TactiChat logo
Developer Documentation

Bot Documentation

Create bots, install them into guilds, send messages through the bot API, and register webhooks or slash commands.

Start Here

Quick Start

Create a bot in User Settings, copy the Client ID and one-time Client Secret, then share the bot's install URL with a guild owner.

1. Create

Open User Settings, choose My Account, then Bots. Create a bot and store the secret securely.

2. Install

Send an OAuth-style install URL to a guild owner. Owners choose the guild and approve requested permissions.

3. Build

Use any of our official SDKs to register slash commands, create your webhook, and handle events.

Credentials

Authentication

Bot runtime requests authenticate with the Client ID and Client Secret. The Client ID stays stable; roll the secret if it leaks.

Header Auth

Bearer Secret

Contracts

Error Responses

Bot API errors include a stable code field so integrations and future SDKs can branch on machine-readable failures.

Code Meaning
BOT_CREDENTIALS_INVALIDThe Client ID or Client Secret is wrong.
BOT_DISABLEDThe bot was globally disabled by TactiChat.
BOT_NOT_INSTALLEDThe bot is not installed in the requested guild.
BOT_PERMISSION_MISSINGThe guild install does not grant the required permission.
BOT_INTERACTION_EXPIREDThe slash command response window expired.
BOT_RATE_LIMITEDThe bot exceeded runtime API rate limits.
Guild Grants

Permissions

Guild owners approve permissions when they install a bot. Bot developers can request permissions with an install URL, but installed guild permissions are controlled by that guild owner.

Permission Allows
READ_MESSAGESList channels and receive message events.
SEND_MESSAGESSend bot messages and interaction responses.
DELETE_OTHER_MESSAGESDelete messages in guild text channels.
USE_SLASH_COMMANDSRegister and receive slash command interactions.
CREATE_CHANNELSCreate text and voice channels.
RENAME_CHANNELSRename channels and update voice channel settings.
DELETE_CHANNELSDelete guild channels.
ADMINISTRATORGrant all bot permissions in that guild.
Messages

Runtime API

Use runtime endpoints from your bot service after the bot is installed in a guild.

POST /bot-api/channels/:channelId/messages

Sends a message as the bot. Requires SEND_MESSAGES.

GET /bot-api/guilds/:guildId/channels

Lists channels in an installed guild. Requires READ_MESSAGES.

DELETE /bot-api/messages/:messageId

Deletes a message in a guild text channel. Requires DELETE_OTHER_MESSAGES.

POST /bot-api/guilds/:guildId/channels

Creates a text or voice channel. Requires CREATE_CHANNELS.

POST /bot-api/channels/:channelId/settings

Renames a channel or updates voice channel bitrate, video quality, and user limit. Requires RENAME_CHANNELS.

DELETE /bot-api/channels/:channelId

Deletes a guild channel. Requires DELETE_CHANNELS.

SDK

JavaScript SDK

The JavaScript SDK wraps bot credentials, slash command registration, webhook verification, and interaction responses so bot developers do not need to hand-roll REST calls.

Create a .env file beside your bot. The SDK loads it automatically, uses https://tactichat.com by default, creates or reuses the webhook at /webhooks/tactichat, and stores the webhook signing secret locally in .tactichat-bot.json.

Useful SDK Methods

Use TACTICHAT_API_BASE_URL only for local or staging TactiChat servers. Use TACTICHAT_BOT_PUBLIC_WEBHOOK_URL only when you need to override the default webhook path.

Events

Webhooks

Webhook subscriptions receive events for guilds where the bot is installed. Creating a webhook returns a one-time signing secret.

Webhook URLs must use public http or https hosts. Localhost, private networks, link-local addresses, and unresolved hosts are rejected by TactiChat. The SDK handles webhook signing secret storage automatically for SDK-created webhooks.

POST /bot-api/webhooks

Supported Events

Transient failures are retried once. Webhooks are automatically disabled after repeated failed delivery attempts, 10 by default, and can be re-enabled by the bot owner.

Verify Signatures

Compute an HMAC SHA-256 signature over timestamp.body using the webhook signing secret, then compare it to x-tactichat-signature.

Interactions

Slash Commands

Bots can register global or guild-scoped command definitions. Users invoke them by typing /command in a text channel.

Slash command interactions include parsed mentions.users when users are mentioned in the argument text. Bot messages can mention one or more users by sending normal @username text.

POST /bot-api/slash-commands

Interaction Payload

Subscribed webhooks receive an interaction id, raw argument text, parsed option values, and an expiresAt timestamp. Interactions must be answered before they expire, 15 minutes by default.

POST /bot-api/interactions/:interactionId/respond
Clients

Client Support

Web, desktop, and mobile text channels support slash command invocation through the normal message endpoint. The web and desktop apps include the full bot management UI in User Settings. Mobile shows bot lists and documentation access, with deeper bot creation and credential management planned as a native follow-up.

Operational Rules

Platform Limits

Reference

Endpoint Reference

Method Path Purpose
GET/bot-api/meReturn the authenticated bot.
GET/bot-api/guildsList guild installs.
GET/bot-api/guilds/:guildId/channelsList guild channels.
POST/bot-api/guilds/:guildId/channelsCreate a text or voice channel.
GET/bot-api/guilds/:guildId/membersList guild members for mention resolution.
POST/bot-api/channels/:channelId/messagesSend a bot message.
DELETE/bot-api/messages/:messageIdDelete a guild text-channel message.
POST/bot-api/channels/:channelId/settingsRename a channel or update voice settings.
DELETE/bot-api/channels/:channelIdDelete a guild channel.
GET/bot-api/webhooksList webhooks.
POST/bot-api/webhooksCreate a webhook.
POST/bot-api/webhooks/:webhookId/enableRe-enable a disabled webhook.
GET/bot-api/slash-commandsList slash commands.
POST/bot-api/slash-commandsCreate or update a slash command.
POST/bot-api/interactions/:interactionId/respondRespond to a slash interaction.