RuItUnion.FeedbackBot 1.7.1

dotnet add package RuItUnion.FeedbackBot --version 1.7.1
                    
NuGet\Install-Package RuItUnion.FeedbackBot -Version 1.7.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RuItUnion.FeedbackBot" Version="1.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RuItUnion.FeedbackBot" Version="1.7.1" />
                    
Directory.Packages.props
<PackageReference Include="RuItUnion.FeedbackBot" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RuItUnion.FeedbackBot --version 1.7.1
                    
#r "nuget: RuItUnion.FeedbackBot, 1.7.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RuItUnion.FeedbackBot@1.7.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RuItUnion.FeedbackBot&version=1.7.1
                    
Install as a Cake Addin
#tool nuget:?package=RuItUnion.FeedbackBot&version=1.7.1
                    
Install as a Cake Tool

Feedback Bot

build-and-test

A free and open-source Telegram Bot that allows you to anonymously chat with multiple users in one Telegram Chat.

When a new user interacts with the Feedback Bot by sending a message, the bot forwards the message to a specific topic dedicated to that user within the Feedback Chat. If a topic for the user does not already exist, the bot creates a new one. This ensures that each user's message is organized in its own topic, allowing for clear and efficient interaction.

Created and supported by Russian IT Union.

📝 Prerequisites

  1. Telegram Bot Token;
  2. Telegram Chat ID;
  3. PostgreSQL 18 (automatically deployed via Docker Compose).

🛠️ Prepare the Environment

Telegram bot

  1. Create a bot with @BotFather;
  2. After successfully creating the bot, you will receive a Telegram Bot Token.

Feedback Chat

  1. Create a private chat;
  2. Enable topics;
  3. Get the Telegram Chat ID;

You can get the ID of any user / chat / bot using desktop Telegram client. To do that go to Settings / Advanced / Experimental settings and enable Show peer ID in Profile. Now you will be able to see all the IDs.

how_to_get_id

  1. Add the bot from the previous step and make it Administrator;
  2. The only permission required for the bot is to manage topics.

required_permissions

🚀 Run

From GitHub Container Registry

  1. Download docker-compose.yml & feedback_bot.env files into one folder;
  2. Edit feedback_bot.env with any text editor and replace these values:
    • <bot_token> with Telegram Bot Token,
    • <chat_id> with Telegram Chat ID,
    • <start_text> with your greeting message your new users;
  3. Run the following command:
docker compose up -d

This will start three services:

  • feedback_bot — the bot itself
  • database — PostgreSQL 18
  • dashboard — .NET Aspire Dashboard (monitoring, metrics, traces)

From source code

  1. Clone this repo;
  2. Edit feedback_bot.env with any text editor and replace these values:
    • <bot_token> with Telegram Bot Token,
    • <chat_id> with Telegram Chat ID,
    • <start_text> with your greeting message your new users;
  3. Edit docker-compose.yml: in feedback_bot section change image value to ghcr.io/ruitunion-org/feedback-bot:local
  4. Run the following commands:
docker build -t ghcr.io/ruitunion-org/feedback-bot:local -f ./RuItUnion.FeedbackBot/Dockerfile .
docker compose up -d

⚙️ Configuration

Environment variables

Variable Description Required
ConnectionStrings__Telegram Telegram Bot Token Yes
AppOptions__FeedbackChatId Feedback Chat ID Yes
AppOptions__Start Welcome message for /start command Yes
ConnectionStrings__RuItUnion-FeedbackBot-Database PostgreSQL connection string Yes
Migrator__UpdateDatabase Auto-apply EF Core migrations (true/false, default true) No
AppOptions__OverrideCultureTag Force locale (e.g. ru-RU) No
AppOptions__FeedbackBotToken Alternative way to provide bot token No
ALL_PROXY SOCKS5 proxy (e.g. socks5://user:pass@host:port) No
OTEL_EXPORTER_OTLP_ENDPOINT OpenTelemetry OTLP endpoint No
OTEL_SERVICE_NAME OpenTelemetry service name No
HTTP_PORTS HTTP ports (default 8080) No

Feature flags

Feature flags are configured in appsettings.json under feature_management:

Flag Default Description
ChinaSpamFilter true Detects Chinese spam by CJK character ratio (>15%)
UaPropagandaFilter true Detects Ukrainian propaganda by regex patterns
CsvReports true Enables /TopicCsv command for CSV reports
ForceCultureSet false Forces a specific locale via AppOptions__OverrideCultureTag
LegacyCommands false Enables legacy command aliases (/addadmin, /closetask, /settaskname)
DoNotAllowEmptyHeader false Rejects topics with empty header
EnableMigratorFromV01 false Enables data migration from v0.1 schema

🌟 Features

Commands

Commands other than /start are only available in group chat. Use /help to get information about all commands.

General
  • /start — Starts the bot and displays a welcome message.
  • /help — Displays a list of all commands with their descriptions.
Topic Management
  • /delete — Removes a reply in the user chat.
  • /open — Opens a topic in the feedback chat.
  • /close — Closes a topic in the feedback chat.
  • /link <id> — Replies with a link to the last message of a topic.
  • /forceSend <text> — Force-sends a message to the user.
  • /TopicList — List all open topics with links.
Tags
  • /tag — View tags of the current topic.
  • /tag <key> <value> — Set a tag on the current topic.
  • /tagRemove <key> — Remove a tag from the current topic.
  • /tag <id> <key> <value> — Set a tag on a topic by its number.
  • /tagList — List all tags with usage counts.

Special tag keys:

  • header — Sets the topic header/description (displayed in forum title)
  • type — Request type
  • result — Result (true/false, success/fail, 1/0)

Shorthand syntax: #key value (no spaces in key).

Reports
  • /TopicCsv — CSV report of all topics.
  • /TopicCsv <date> — CSV report filtered by minimum date.
  • /TopicCsv <start_date> <end_date> — CSV report for a date range.
Moderation
  • /ban — Bans the user.
  • /unban — Unbans the user.
Spam Management
  • /spamInfo <id> — Shows user info and spam message text.
  • /spamDownload <id> — Downloads full spam info as JSON.
  • /spamRestore <id> — Restores a spam message and creates a topic.

Permissions

Command Bot User Chat User Chat Admin Service Admin
/help
/start
/delete
/open
/close
/ban
/unban
/tag
/tagRemove
/list
/tagList
/csv
/link
/forceSend
/sync
/spamInfo
/spamDownload
/spamRestore

Anti-Spam System

Two spam filters are available (enabled via feature flags):

  • ChinaSpamFilter — detects Chinese spam by CJK character ratio (>15%).
  • UaPropagandaFilter — detects Ukrainian propaganda by regex patterns.

When spam is detected: the user is banned, the message is saved to the database, and admins receive a notification with the spam ID.

Message Editing

Operators can edit messages in the feedback chat — changes are automatically synced to the user.

Auto Role Sync

Chat administrators of the feedback chat automatically receive the admin role in the bot upon sending a command.

Observability

The bot exposes HTTP endpoints:

  • /health — health check endpoint (includes Telegram API check)
  • /alive — liveness probe
  • /metrics — Prometheus metrics endpoint

Rate Limiting

Command rate limit: 1 request per second (configurable in RateLimit section).

Proxy Support

SOCKS5 proxy is supported via the ALL_PROXY environment variable.

🏗️ Architecture

The project consists of six sub-projects:

Project Purpose
RuItUnion.FeedbackBot Main bot application (ASP.NET Core)
RuItUnion.FeedbackBot.AppHost .NET Aspire AppHost for orchestration
RuItUnion.FeedbackBot.Data Data layer (EF Core, PostgreSQL)
RuItUnion.FeedbackBot.Data.Old Data migration from v0.1
RuItUnion.FeedbackBot.ServiceDefaults Shared .NET Aspire services (OpenTelemetry, health checks)
RuItUnion.FeedbackBot.Tests Unit tests (xUnit)

🤝 Contributing

Contributions are welcome. Here are some ways you can help:

  1. Report bugs: If you find a bug, please report it by creating an issue on GitHub;
  2. Request features: Have an idea for a new feature? Let us know by creating a feature request;
  3. Submit pull requests: If you'd like to fix a bug or add a feature, feel free to fork the repository and submit a pull request.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.1 51 7/31/2026
1.6.0 107 7/19/2026
1.5.0 92 7/16/2026
1.4.6 117 6/11/2026
1.4.5 125 3/6/2026
1.4.4 200 12/21/2025
1.4.3 191 12/21/2025
1.4.2 291 12/14/2025 1.4.2 is deprecated because it has critical bugs.
1.4.1 331 12/8/2025
1.4.0 244 11/24/2025
1.3.2 323 11/12/2025
1.3.1 189 11/8/2025
1.3.0 235 9/8/2025
1.1.1 295 9/5/2025 1.1.1 is deprecated because it has critical bugs.
1.1.0 282 8/28/2025
1.0.0 273 8/27/2025
0.2.7 271 8/27/2025
0.2.6 282 8/26/2025
0.2.5 218 8/11/2025
0.2.4 631 7/23/2025
Loading failed