This repository contains source code of a small yet rather powerful bot for Telegram, which handles reports from users
and passes them to admins.
Uses aiogram framework.
The main goal is to build a bot with no external database needed. Thus, it may lack some features, but hey, it's open
source!
/start
to start bot;- Supports can be sent to a dedicated chat;
- Write message to bot if you are simple user;
- Write reply message to questions if you are owner;
/mute
to mute users (muted users can't send message to bot);/unmute
to un mute users;
- Python 3.9 and above;
- Tested on Linux, should work on Windows, no platform-specific code is used;
-
Go to @BotFather, create a new bot, and get token.
-
Clone this repository:
git clone https://github.com/Saidalo1/telegram_support_bot.git
-
Open project directory:
cd telegram_support_bot
-
Create .env file to project directory:
BOT_TOKEN=YOUR_BOT_TOKEN OWNER_ID=OWNER_TELEGRAM_USER_ID DATABASE_USER=DATABASE_USER DATABASE_PASS=DATABASE_USER_PASSWORD DATABASE_HOST=DATABASE_HOST DATABASE_NAME=DATABASE_NAME
- Create a venv (virtual environment):
python3.9 -m venv venv
(or any other Python 3.9+ version); source venv/bin/activate && pip install -r requirements.txt
;- Rename
supportbot.service.example
tosupportbot.service
and move it to/etc/systemd/system
; - Open that file and change values for
WorkingDirectory
,ExecStart
andEnvironmentFile
providing the correct path values; - Start your bot and enable its autostart:
sudo systemctl enable supportbot.service --now
; - Check your bots status and logs:
systemctl status supportbot.service
.