yshalsager / telegram-feedback-bot

A Telegram feedback bots builder with topics support.
MIT License
9 stars 6 forks source link
livegram livegram-bot pyrogram pyrogram-bot telegram telegram-bot

Telegram Feedback Bots Builder

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.

Features

Builder

Bots

Configuration

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.

Running

Docker

Poetry

Usage

Builder

Bots

How it works?

Acknowledgements

Libraries, Tools, etc

Development

This project uses several tools to streamline the development process:

mise

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:

  1. Install mise by following the instructions on the official website.
  2. Run mise install in the project root to set up the development environment.

Poetry

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:

  1. Install Poetry by following the instructions on the official website.
  2. Run poetry install to install project dependencies.

Jurigged for Live Reload

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:

  1. Make sure you have installed the project dependencies using Poetry, including dev dependencies poetry install --with dev.
  2. Run the bot with Jurigged:
poetry run jurigged -v -m src

Internationalization (i18n)