/start
- starting the bot/register [registration token]
- registration with a token (usage example:/register A0123456789
)/makereport
- new report/updatereport
- update one of 5 last committed reports/exportxlsx
- providesxlsx
-file with all tracked data/exportcsv
- providescsv
-file with all tracked data/exporttext
- shows all tracked data in a message/exportmedia
- provides all the media that has been uploaded for all jobs in azip
-archive/importxlsx
- upload new job list/promote [user id]
- promote to a specific role (usage example:/promote 123
)/users
- list all the users/token
- generate registration token/en
- switch to english/ru
- switch to russian/lang [country code]
- change the language to any other https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 (usage example:/lang ja
)/help
- use for help
ANONYMOUS
- unregistered usersUSER
- base users who make daily reportsMANAGER
- those who collect data and manage reportsSERVICE
- same as MANAGER but have rights for registering new usersADMIN
- have both rights to make and collect reports; also can change manage rolesSUPERUSER
- the headmaster
Add config.properties
in ./src/main/resources
with several environment variables:
bot.name
- name of your bot (ex:@test_bot
)bot.token
- bot tokenbot.superuser
- admin id. As soon as you introduce yourself to bot with/start
, you will getSUPERUSER
roletoken.salt
- salt for generating registration tokens
Use docker-compose up -d
to start
- If docker fails use
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
Container | Port | Purpose |
---|---|---|
backend | 8080:8080 | server; bot controller |
postgres | 5432:5432 | database |
promtail | logs collector | |
loki | 3100:3100 | handles promtail logs database |
grafana | 3000:3000 | for bot metrics (logs as one of) |
- Grafana (http://localhost:3000) → Dashboards → General → telegram-smg-gazpromcps
- [Real time logging] Exprore → loki →
job="telegram-smg-logs"
→ Run query