Skip to main content

Authentication Method

  • bot_token - Telegram bot token

Bot Token Setup

Step 1: Create a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Start a chat and send /newbot
  3. Follow the prompts to choose a name and username for your bot
  4. BotFather will send you a token like 123456789:ABCdef...
  5. Copy and store it securely
Storing Credentials:
pnpm corsair setup --plugin=telegram bot_token=your-bot-token

Webhook Setup (Optional)

Telegram webhooks use a secret token for verification.
  1. Generate a random secret string
  2. Store it as the webhook signature:
pnpm corsair setup --plugin=telegram webhook_signature=your-secret-token
  1. Register the webhook URL with Telegram:
await corsair.telegram.api.webhook.setWebhook({
    url: "https://yourapp.com/webhooks/telegram",
    secret_token: "your-secret-token",
});

Required Credentials Summary

CredentialRequired ForWhere to Find
Bot TokenAll API callsTelegram @BotFather
Webhook SecretWebhook verificationSelf-generated
For general information about how Corsair handles authentication, see Authentication.