Telegram bot that forwards messages to a separate chat (channel, group or account).
Intended to keep evidence when scammers edit or delete messages. Anti-gaslighting tool.
DigitalOcean builds it for us in their App Platform.
- Create a new DigitalOcean App:
- Ensure "Git repository" tab is selected.
- Select a "Git provider" and "Repository" where this source code is hosted.
- Select the "Branch" this application runs from. Usually, the default is fine.
- Leave "Source directories (Optional)" empty.
- Enable automatic deployments if you don't have a separate application for tests.
- Proceed to next step.
- Set up resource settings:
- It's optional to change resource's name (Defaults to
yapkeep). - Change app's "Instance size" to minimal (
512 MB RAM | 1 Shared vCPU | 50 GB bandwidthat$5.00/mo). - At Deployment settings set the Run command to the one specified at the end of this section.
- Leave Network settings at their defaults (Public HTTP port at
8080, no internal ports defined, and HTTP request routes with 1 route set at/). - Add environment variables on the resource, by clicking on the "Add from .env" button.
- Copy the template from .env-sample and fill in the values. Click on "Save" button once done.
- Recommended: Set all environment variables to
Run timein the "Scope" setting for each one. - Recommended: Enable encryption for every variable that ends with
_KEY.
- It's optional to change resource's name (Defaults to
- Skip creating "App-level environment variables", as these are not necessary for this project.
- Select a "Region" for your app to be deployed.
- The closer to Telegram servers, the better. A reference: What are the IP addresses of Telegram Data Centers?.
- Finalize step:
- Choose a unique app name. The default setting is fine.
- Select a project. It defaults to the one you're currently at.
- Can be left as is if this is your first time using DigitalOcean.
- Click on the "Create app" button on the right sidebar.
Run command: gunicorn --worker-tmp-dir /dev/shm --pythonpath 'bot' --workers=3 --capture-output --enable-stdio-inheritance "app:app"
BOT_WEBHOOK_KEY: Part of the URL that Telegram hits when sending us notifications. Used as an anti-spam measure, security-through-obscurity (Currently, Telegram doesn't support a better way).- Just generate any random alphanumeric string, with at least 16 characters.
- How it ends up looking:
https://<app_fdqn>/webhook/<bot_webhook_key>
OPT_PRETTYPRINT: Pretty-print output JSONs on HTTP requests.TG_API_KEY: Telegram's main bot API key. Obtained through BotFather.TG_OUTPUT_CHAT_ID: Output chat of the message logging activity. It could be a channel, group or individual account.
Refer to .env-sample file for an updated environment variables template.
This page has been intentionally left blank.
Open a new GitHub Issue on this repo, and I'll provide an email for professional services.
I charge a one-time setup fee on your server.