A bot that builds feedback Telegram bots like Livegram but with topics support.
Note: If you don't need a builder and just want one feedback bot, checkout standalone branch.
Create a .env file and fill it with requires values from mise.toml
env section.
[env]
# the Telegram bot token https://telegram.me/BotFather
BOT_TOKEN = '0000000000:aaaaaaaaaaaaaaaaaaaa'
# to connect to MTProto, which we use to upload media files (retrieve from https://my.telegram.org)
API_ID = '0000000'
API_HASH = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
# the Telegram account IDs that will have administrator permissions of the bot
BOT_ADMINS = '000000,000000,000000'
# Chat that will receive the bot messages
CHAT_ID = '-10000000000'
# Group topic that will be used for bot logs
LOG_TOPIC_ID = 1
# Require admin approval to add new bot
NEW_BOT_ADMIN_APPROVAL = "true"
DEBUG = 1
Create an encryption key with mise r generate-encryption-key
or python -c "from secrets import token_bytes; print(token_bytes(32).hex())"
and update ENCRYPTION_KEY
variable.
docker compose up
poetry install
python3 -m src
/start
: sends the main menu to create and manage bots./whitelist [user_id]
: adds new users to the whitelist.'/manage
: manage users and bots by admin./broadcast
: sends a message to all bot users. Send as a reply to a message previously sent to the bot./restart
: restarts the bot./update
: updates the bot code./start
: says hello./broadcast
: sends a message to all bot users. Send as a reply to a message previously sent to the bot./stats
: shows bot statistics.This project uses several tools to streamline the development process:
We use mise for managing project-level dependencies and environment variables. mise helps ensure consistent development environments across different machines.
To get started with mise:
mise install
in the project root to set up the development environment.Poetry is used for dependency management and packaging. It provides a clean, version-controlled way to manage project dependencies.
To set up the project with Poetry:
poetry install
to install project dependencies.We use Jurigged for live code reloading during development. This allows you to see changes in your code immediately without manually restarting the application.
To use Jurigged:
poetry install --with dev
.poetry run jurigged -v -m src
src/i18n/locales
directory, the default locale is en_US
.src/i18n/locales
directory, with the corresponding language
code,
translate the messages to that language.