Create a bot
Choose Bot, select the least permissions it needs, and save the token when it appears — it's shown once.
Krit DevelopersEarly access
Build bots and integrations that feel at home in Krit—from game-night helpers to campaign tools.
// Your bot identity const bot = await krit.me(); console.log( `Ready as ${bot.name}` );
Loading your projects…
Identity, server install, messaging, events, OAuth login, and the public directory are all live — this is the fastest path through them.
Choose Bot, select the least permissions it needs, and save the token when it appears — it's shown once.
Store it only in your server environment. Krit stores a hash and cannot show it again.
curl https://voice.krit.gg/api/bot/v1/me \ -H "Authorization: Bot YOUR_TOKEN"
Copy the install link from your bot's management panel and send it to a server owner — it opens the consent dialog directly.
curl -X POST https://voice.krit.gg/api/bot/v1/channels/CHANNEL_ID/messages \
-H "Authorization: Bot YOUR_TOKEN" -H "Content-Type: application/json" \
-d '{"content":"Hello from my bot!"}'Add buttons and react to clicks (Message actions), receive events in real time (Webhooks & events), sign users in on your own site (OAuth login), or get discovered (Bot directory).
A bot with the messages.read scope receives a signed POST for every event it can see, in every server it's installed in.
Open your bot's management panel and save a URL under Event delivery — Krit shows you a signing secret once, at save time.
expected = "sha256=" + hmac.new( secret.encode(), request_body, hashlib.sha256 ).hexdigest() hmac.compare_digest(expected, headers["X-Krit-Signature"])
The X-Krit-Event header (and the payload's type field) is one of message_created, message_edited, message_deleted, message_reaction, or message_action_clicked. Every payload includes application_id, guild_id, channel_id.
Attach up to 5 buttons to a message your bot sends; a click is delivered to your webhook, not called back through some separate actions API.
curl -X POST https://voice.krit.gg/api/bot/v1/channels/CHANNEL_ID/messages \
-H "Authorization: Bot YOUR_TOKEN" -H "Content-Type: application/json" \
-d '{"content":"Roll for initiative!",
"buttons":[{"label":"Roll d20","custom_id":"roll_d20"}]}'...within that one message. Up to 5 buttons; reuse a custom_id across different messages freely.
A click arrives as a message_action_clicked webhook event (see Webhooks & events) carrying message_id, custom_id, and the clicking user. Respond by sending a new message back to the same channel.
Identity-only OAuth2 authorization-code login for an Application-type project — not for bots, and not for anything beyond username, display name, and user id.
https://voice.krit.gg/oauth/authorize ?response_type=code&client_id=YOUR_ID &redirect_uri=YOUR_EXACT_REGISTERED_URI&state=RANDOM
curl -X POST https://voice.krit.gg/oauth/token \ -d grant_type=authorization_code -d code=CODE \ -d client_id=YOUR_ID -d client_secret=YOUR_SECRET \ -d redirect_uri=YOUR_EXACT_REGISTERED_URI
The code expires in 60 seconds and works once — exchange it immediately.
curl https://voice.krit.gg/oauth/userinfo \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
An opt-in public listing — no manual review, no waiting period.
The directory listing toggle stays disabled until your bot has one — it's what server owners see before installing.
In your bot's management panel: Listed in the public bot directory. Live immediately.
Anyone signed in can search GET /api/bot-directory?q=... and install straight from the results — install_count updates live as servers add or remove your bot.
Every application declares its intended access. Server owners will review these scopes before installation.