Skip to content

Creating a bot

Creating an application creates its bot user and its first bot token in one step. You can do it in the TEBHOS app or through the HTTP API. Either way you need a regular, claimed TEBHOS account; unclaimed (guest) accounts cannot create applications.

In the TEBHOS app

  1. Open User Settings (the gear next to your name).
  2. In the Developer section of the sidebar, choose Applications.
  3. Select Create application, enter an application name and confirm.
  4. The application page opens. Under Secrets & tokens, copy the Bot token and store it somewhere safe.

The same page lets you edit the bot's profile (name, avatar, banner, bio), regenerate the bot token and the client secret, and build an authorization link under OAuth2 URL builder (see Adding a bot to a guild).

The token is shown once

TEBHOS stores only a hash of the bot token and the client secret. They are returned in full only when they are created or regenerated. If you lose the bot token, regenerate it.

With the HTTP API

All application-management endpoints need a user session (Authorization: Bearer ...). A bot token cannot manage applications. Paths are relative to https://tebhos.com/api/v1.

Create application

POST /oauth2/applications

Creates an application, its bot user and its first bot token. Rate limit: 10 per hour per user. Each user can own at most 25 applications; creating a 26th returns 400 with code MAX_APPLICATIONS.

When the instance has a captcha enabled, this request must also carry the captcha headers x-captcha-token and x-captcha-type, see Captcha. Creating the application in the TEBHOS app handles this for you.

Field Type Description
name string Application name, 1–100 characters
redirect_uris? array of strings OAuth2 redirect URIs. Only needed for OAuth2 flows other than a plain bot invite
bot_public? boolean Whether anyone with Manage Server can add the bot to their guild. Default true. When false, only you can add it
bot_require_code_grant? boolean Require a full OAuth2 code grant (with a redirect URI) when the bot is added. Default false
curl -X POST https://tebhos.com/api/v1/oauth2/applications \
  -H "Authorization: Bearer $TEBHOS_USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Night Watch"}'
{
  "id": "1290847135893127168",
  "name": "Night Watch",
  "redirect_uris": [],
  "bot_public": true,
  "bot_require_code_grant": false,
  "bot": {
    "id": "1290847135893127168",
    "username": "Night_Watch",
    "discriminator": "0001",
    "avatar": null,
    "banner": null,
    "bio": null,
    "mfa_enabled": false,
    "authenticator_types": [],
    "flags": 0,
    "token": "1290847135893127168.q3JxY2V0...W5k"
  },
  "client_secret": "Zk9hc2Rm...Tmdh"
}

The bot user's ID is the application ID. Its username is derived from the application name: letters, digits and underscores are kept, spaces, hyphens and dots become underscores, other characters are dropped, and the result is cut to 32 characters. If that leaves fewer than 2 characters, a random name is chosen. The discriminator is the first one still free for that username. You can rename the bot afterwards.

bot.token and client_secret appear only in this response. See Applications for the full application object.

List your applications

GET /oauth2/applications/@me

Returns an array of the applications you own, without secrets. Rate limit: 60 per minute. GET /users/@me/applications returns the same list.

Get application

GET /oauth2/applications/{application_id}

Returns one of your applications. Returns 403 if you are not its owner.

Update application

PATCH /oauth2/applications/{application_id}

Updates name, redirect_uris (replaces the whole list), bot_public or bot_require_code_grant. Every field is optional. Rate limit: 30 per minute per application.

Update bot profile

PATCH /oauth2/applications/{application_id}/bot

Changes the bot user's public profile. Rate limit: 30 per minute per application.

Field Type Description
username? string New username, 2–32 characters. The discriminator is kept if it is free under the new name, otherwise a free one is assigned
discriminator? integer Cannot be changed; any value other than the current one returns 400
avatar? ?string Image as a data URI (data:image/png;base64,...), PNG, JPEG, GIF or WebP, at most 8 MiB. null removes it
banner? ?string Same format as avatar. null removes it
bio? ?string Up to 1024 characters. null removes it
bot_flags? integer Only the bits 1 << 4 and 1 << 5 are applied; every other bit is ignored

The response is the bot's profile: id, username, discriminator, avatar, banner, bio and flags.

Regenerate the bot token

POST /oauth2/applications/{application_id}/bot/reset-token

Issues a new bot token and invalidates the old one immediately. Every open gateway connection of the bot is closed, so your bot must reconnect with the new token. Rate limit: 10 per hour per application.

This is a sensitive action that needs sudo mode: include your password, an mfa_code, or a passkey sudo_proof in the JSON body, or perform the request within a few minutes of another successful sudo verification. Without it the request returns 403 with code set to SUDO_REQUIRED. See Authentication.

curl -X POST https://tebhos.com/api/v1/oauth2/applications/1290847135893127168/bot/reset-token \
  -H "Authorization: Bearer $TEBHOS_USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"password": "your-account-password"}'
{
  "token": "1290847135893127168.Tm90QVJl...YWxUb2tlbg",
  "bot": { "id": "1290847135893127168", "username": "Night_Watch", "discriminator": "0001", "flags": 0 }
}

Regenerate the client secret

POST /oauth2/applications/{application_id}/client-secret/reset

Issues a new client secret, returned once as client_secret on the application object. Same sudo requirement and rate limit as the bot token.

Delete application

DELETE /oauth2/applications/{application_id}

Deletes the application. Its bot is removed from every guild, its profile is anonymised and its gateway connections are closed; messages it already sent stay in place. Needs sudo mode. Rate limit: 10 per hour per application. Returns 204.

Check a bot token

GET /applications/@me

Called with the bot token, returns the bot's own application. Any other credential returns 401. Use it to confirm a token works before connecting to the gateway.

curl https://tebhos.com/api/v1/applications/@me \
  -H "Authorization: Bot $TEBHOS_BOT_TOKEN"
Field Type Description
id snowflake Application ID (also the bot user ID)
name string Application name
icon ?string The bot user's avatar hash
description ?string The bot user's bio
bot_public boolean See Create application
bot_require_code_grant boolean See Create application
verify_key string Always 64 zeros. TEBHOS does not sign outgoing requests to bots
owner object Partial user: id, username, discriminator, global_name, avatar
redirect_uris array of strings Registered redirect URIs
bot? object The bot user, without its token

Next: add the bot to a guild, then connect to the gateway.