Group Activity Bot (GAB) is a Telgram bot that will keep track of user activities in groups, e.g.
GAB only works in group and must be a group admin in order to receive each user message in a group
Command | Action |
---|---|
/groupstats |
Returns a message containing the total number of messages exchanged in the group and the percentege of messages per user, with nice emojis for the top 3 users |
/userstats <username> |
Returns a message containing the percentage of messages of a specific user in a group |
/statsfile |
Returns a .csv file containing (message timestamp, username) for all the messages exchanged in a group, this is helpful to plot graphs and other analytics with other softwares |
I personally run rust bots on my raspberry and let systemd handle them
Create a service file, e.g. /etc/systemd/system/bot.service
[Unit]
Description=Telegram Bot Service
After=network.target
[Service]
Type=simple
User=<user>
Group=<group>
Restart=always
RestartSec=10
ExecStart=/usr/local/bin/bot
Environment="TELOXIDE_TOKEN=<token>"
[Install]
WantedBy=multi-user.target
Copy the bot binary in /usr/local/bin/
Enable the service so that it boots on reboot and start it
$ sudo systemctl enable bot.service
$ sudo systemctl start bot.service