Alita is a Telegram Group managment bot made using Gotgbot and Go, which makes it modern and faster than most of the exisitng Telegram Chat Managers.
Alita's features over other bots:
- Modern
- Fast
- Fully asynchronous
- Fully open-source
- Frequently updated
- Multi Language Support
Can be found on Telegram as @Alita_Robot
Alita is currently available in 1 Language as of now:
- US English
More languages can be managed in the locales folder. Although we have added support for languages in bot, we still need contributors to translate the bot to other languages.
More languages have been added to locales folder but need some configuration.
Help us bring more languages to the bot by contributing to the project on Opening Pull Requests.
- You need to have a PostgreSQL Database (Recommended) or Supabase (Even Better)
- You also need a Redis Database for caching (Required): Get a free redis database from here
- Linux/Windows machine (Ubuntu/Debain-based OS Preferred or Windows 10/Server2016 and later)
or
- Docker (Easiest way to setup the bot)
First Step!
- Star β the repository!!
- Fork π± the repository before deploying and make changes in the fork.
It really motivates me to continue this project further.
- Get your
API_ID
andAPI_HASH
from here - Get your Bot Token from @BotFather
Note: As it is banned with an unknown reason in heroku, follow the below steps carefully!
- First Fork this repo
:)
- secondly, create an empty app in the Heroku, with a custom app name; and select Europe region for faster speed.
- Now go to the deploy tab of your app and under deployment method select GitHub and connect it.
- after that, type the forked repo name and select it now select main branch and enable auto deploy, at last click on deploy now button!
- Lastly, you must fill up all the vars in heroku (if using heroku) as directed in app.json file and now turn on the worker dyno to run it
:)
Must Add in heroku config :
DATABASE_URL
: Get one from supabaseOWNER_ID
: your telegram idMESSAGE_DUMP
: must be start with-100
or your bot added in as admin
- Download a binary from releases page specific to your PC.
- Set the required env variables and run the binary
Note: Not a lot of people may be able to run using this because the instructions aren't clear but I'll try to make it clear in future.
We currently publish a ghcr.io/divideprojects/alita_robot
Docker image based on alpine.
Set the Environmental vars using the -e
flag in while running the container.
If all works well, bot should send message to the MESSAGE_DUMP Group!
Alita now supports webhook mode for production deployments using Cloudflare Tunnel. This is more efficient than polling and works behind firewalls without opening ports.
- Cloudflare account with a domain added to Cloudflare
- Docker and Docker Compose installed
- Go to Cloudflare Zero Trust Dashboard
- Navigate to Networks > Tunnels
- Click Create a tunnel β Choose Cloudflared
- Name your tunnel (e.g.,
alita-telegram-bot
) - Copy the tunnel token from the command shown (the long string after
--token
)
- In your tunnel dashboard, go to Public Hostnames tab
- Click Add a public hostname
- Configure:
- Subdomain:
alita-bot
(or your preference) - Domain: Select your domain
- Service:
http://alita:8080
- Path:
/webhook/your-secret
(replace with your actualWEBHOOK_SECRET
)
- Subdomain:
Create your .env
file with webhook settings:
# Bot Configuration
BOT_TOKEN=your_bot_token_here
OWNER_ID=your_telegram_user_id
MESSAGE_DUMP=-100xxxxxxxxx
# Database Configuration
DATABASE_URL=postgres://postgres:password@postgres:5432/alita_robot?sslmode=disable
REDIS_ADDRESS=redis:6379
REDIS_PASSWORD=your_redis_password
# Webhook Configuration
USE_WEBHOOKS=true
WEBHOOK_DOMAIN=https://alita-bot.yourdomain.com
WEBHOOK_SECRET=your-random-secret-string-here
WEBHOOK_PORT=8080
# Cloudflare Tunnel
CLOUDFLARE_TUNNEL_TOKEN=eyJhIjoiNzU1...your-tunnel-token-here
Uncomment the cloudflared
service in your docker-compose.yml
:
# Uncomment this section for webhook mode
cloudflared:
image: cloudflare/cloudflared:latest
container_name: alita-cloudflared
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
command: tunnel --no-autoupdate run
restart: unless-stopped
depends_on:
- alita
deploy:
resources:
limits:
memory: 128M
cpus: "0.1"
After your bot is running, register the webhook URL with Telegram:
# Replace YOUR_BOT_TOKEN with your actual bot token
# Replace the URL with your actual webhook URL
curl -X POST "https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook" \
-H "Content-Type: application/json" \
-d '{
"url": "https://alita-bot.yourdomain.com/webhook/your-secret",
"secret_token": "your-secret"
}'
docker-compose up -d
Check webhook status:
curl "https://api.telegram.org/botYOUR_BOT_TOKEN/getWebhookInfo"
To disable webhooks and return to polling mode:
# Clear webhook
curl -X POST "https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook" -d "url="
# Update environment
USE_WEBHOOKS=false
Feature | Webhook Mode | Polling Mode |
---|---|---|
Performance | β‘ Real-time updates | π 1-3 second delay |
Resource Usage | π Lower CPU/bandwidth | π‘ Higher CPU/bandwidth |
Setup Complexity | π§ Requires domain setup | β Simple, works anywhere |
Production Ready | β Recommended | |
Firewall Friendly | β Works behind NAT | β Needs outbound access |
You can download all binaries and release artifacts from the Releases page. Binaries are built for macOS, Linux, Windows, for amd64 and arm64 architectures.
If a binary does not yet exist for the OS/architecture you use, please open a GitHub Issue.
You can verify the integrity and authenticity of any released artifact using a public GPG key. All release artifacts are signed and have a corresponding signature file. Release artifacts are available on the Releases page.
gpg --keyserver keyserver.ubuntu.com --recv 9CAFFF2AC5F94C7C
gpg --verify alita_robot_2.0.1_darwin_amd64.tar.gz.sig alita_robot_2.0.1_darwin_amd64.tar.gz || echo "Verification failed!"
- Make sure your PR works and doesn't break anything.
- You must join the support group here.
- Make sure the CI passes.
- Paul Larsen for his Original Marie Source Code and the amazing Gotgbot library.
- ΓΓΓΓHΓLΓ TΓR SPΓRK always motivating me to make this project better.
- jayantkageri for motivating me as well.
- Anony for helping me with bugs and issues in the project.
- Everyone else who inspired me to make this project, more names can be seen on commits!