Multi-purpose bot for the Telegram Messenger based on gotgbot and inspired by Python-Telegram-Bot.
The source code is here so YOU can do what you want with it - don't ask questions about it nor ask for help on how to use it!
- Written in Go
- Uses MySQL database
- Supports plugins
- Whitelist included
- Supports webhooks and long-polling
- Download binaries from Actions tab or build it yourself (
go build) - Copy
.env.exampleto.envand fill it in (you can also use environment variables) - Run it!
To use a webhook, set the webhook-related variables. If you don't, long-polling will be used.
Example with Hookdeck:
- Copy your
https://events.hookdeck.com/e/...URL toWEBHOOK_PUBLIC_URLvariable - Set a webhook port (e.g.
41320) toPORT - Set
WEBHOOK_URL_PATHto a custom path- This is where the internal webhook server will listen on. Gotgbot does not support an empty path.
- Remember to set the
WEBHOOK_PUBLIC_URLtohttps://.../WEBHOOK_URL_PATH. This variable is the URL that is sent to Telegram to notify them to which URL to send their data.WEBHOOK_URL_PATHis not sent to Telegram, nor appended to theWEBHOOK_PUBLIC_URLinternally! It's just used for the internal http server. - For Hookdeck, set "Destionation Type" to "CLI" and insert your path
- Use the Hookdeck CLI:
hookdeck listen 41320 [SOURCE]. You can also usecloudflared, etc. It MUST be HTTPS!
Set the following variables to any value (like "1") to enable them:
PRINT_MSGS: Print all messages the bot receives to the terminalPRETTY_PRINT_LOG: Pretty print logDEBUG: Enable debug logs (verbose, contains secrets!)IGNORE_SQL_MIGRATION: Ignore the SQL migration feature when you want to migrate yourself (for example with PlanetScale since it doesn't support foreign key references).