Telegram bot for creating queue in group chat.
By Alex Solomaha (@CyanoFresh)
Feel free to contribute :)
- Sign Up for chat group
- Randomized Queue
- Persistence - save and load queues from database
- Authentication for
/done
commands - Telegram WebHooks - CPU and network optimization
- User status in queue - done or undone
- Use Telegram's inline buttons for navigation
- Use
telegraf/micro
for lambda-like services
- Clone repo
- Configure environmental variables:
- For development:
cp .env.example .env
- For production: see
.env.example
for available parameters
- For development:
- For development:
npm start
- Configure environmental variables for webhooks: domain and port
- Configure domain in nginx
- Obtain a certificate from Let's Encrypt
- Configure nginx for the bot.
Example config:
server {
if ($host = tg.solomaha.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name tg.solomaha.com;
return 404; # managed by Certbot
}
server {
server_name tg.solomaha.com;
listen 443 ssl; # managed by Certbot
location / {
proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
}
ssl_certificate /etc/letsencrypt/live/tg.solomaha.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/tg.solomaha.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}