RuItUnion.FeedbackBot
1.7.1
dotnet add package RuItUnion.FeedbackBot --version 1.7.1
NuGet\Install-Package RuItUnion.FeedbackBot -Version 1.7.1
<PackageReference Include="RuItUnion.FeedbackBot" Version="1.7.1" />
<PackageVersion Include="RuItUnion.FeedbackBot" Version="1.7.1" />
<PackageReference Include="RuItUnion.FeedbackBot" />
paket add RuItUnion.FeedbackBot --version 1.7.1
#r "nuget: RuItUnion.FeedbackBot, 1.7.1"
#:package RuItUnion.FeedbackBot@1.7.1
#addin nuget:?package=RuItUnion.FeedbackBot&version=1.7.1
#tool nuget:?package=RuItUnion.FeedbackBot&version=1.7.1
Feedback Bot
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
- Telegram Bot Token;
- Telegram Chat ID;
- PostgreSQL 18 (automatically deployed via Docker Compose).
🛠️ Prepare the Environment
Telegram bot
- Create a bot with @BotFather;
- After successfully creating the bot, you will receive a Telegram Bot Token.
Feedback Chat
- Create a private chat;
- Enable topics;
- 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.
- Add the bot from the previous step and make it Administrator;
- The only permission required for the bot is to manage topics.
🚀 Run
From GitHub Container Registry
- Download
docker-compose.yml&feedback_bot.envfiles into one folder; - Edit
feedback_bot.envwith 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;
- 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
- Clone this repo;
- Edit
feedback_bot.envwith 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;
- Edit
docker-compose.yml: infeedback_botsection changeimagevalue toghcr.io/ruitunion-org/feedback-bot:local - 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 typeresult— 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:
- Report bugs: If you find a bug, please report it by creating an issue on GitHub;
- Request features: Have an idea for a new feature? Let us know by creating a feature request;
- 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 | Versions 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. |
-
net10.0
- Aspire.Npgsql (>= 13.4.6)
- Csv (>= 2.0.245)
- Microsoft.VisualStudio.Azure.Containers.Tools.Targets (>= 1.23.0)
- Npgsql.OpenTelemetry (>= 10.0.3)
- OpenTelemetry.Exporter.Console (>= 1.17.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.17.0)
- OpenTelemetry.Instrumentation.Http (>= 1.17.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.17.0)
- TgBotFrame.Commands (>= 3.1.0)
- TgBotFrame.Commands.Help (>= 3.1.0)
- TgBotFrame.Commands.RateLimit (>= 3.1.0)
- TgBotFrame.Commands.Start (>= 3.1.0)
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.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.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 |