{"id":23394290,"url":"https://github.com/al-muhandis/adminhelper","last_synced_at":"2026-04-02T14:52:18.692Z","repository":{"id":258303784,"uuid":"868199865","full_name":"Al-Muhandis/AdminHelper","owner":"Al-Muhandis","description":"Telegram bot moderator to ban spammers (webservice writted in Lazarus)","archived":false,"fork":false,"pushed_at":"2025-11-13T19:34:01.000Z","size":3296,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T21:19:13.400Z","etag":null,"topics":["freepascal","lazarus","moderator-tools","pascal","telegram"],"latest_commit_sha":null,"homepage":"","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Al-Muhandis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-05T18:24:51.000Z","updated_at":"2025-11-13T19:34:05.000Z","dependencies_parsed_at":"2025-10-06T00:14:09.534Z","dependency_job_id":"1da0b66b-8118-48df-97e2-e27f030dcedc","html_url":"https://github.com/Al-Muhandis/AdminHelper","commit_stats":null,"previous_names":["al-muhandis/adminhelper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Al-Muhandis/AdminHelper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al-Muhandis%2FAdminHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al-Muhandis%2FAdminHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al-Muhandis%2FAdminHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al-Muhandis%2FAdminHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Al-Muhandis","download_url":"https://codeload.github.com/Al-Muhandis/AdminHelper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al-Muhandis%2FAdminHelper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freepascal","lazarus","moderator-tools","pascal","telegram"],"created_at":"2024-12-22T06:14:18.042Z","updated_at":"2026-04-02T14:52:18.668Z","avatar_url":"https://github.com/Al-Muhandis.png","language":"Pascal","readme":"\n# Description of the bot's work\nThe bot helps quickly and silently ban spammers. \n \nGroup members notify administrators of spam messages themselves using the `/spam` command. \nThe command should be sent in response to a spam message.\n\nAll administrators receive a copy of the inspected message with the ability to check whether the member has correctly pointed to the spam message. \nIf it is indeed a spam message, the member's rating is increased. \nThe bot can send a notification that the admins need to decide if it is a spammer, or notify the admins that the spammer is banned with the option to rollback, or even silently ban, \nif the likelihood of a ban is high enough based on some factors. The bot can also preventively ban spammers.\nIf the inspected message is incorrectly identified as a spam, the member's rating is downgraded.\n\nIn order for the bot to receive a list of administrators in a group or in case of deleting or adding a new one, it is necessary to send the `/update` command from any of the current administrators.\nDue to the fact that these commands are instantly deleted by the bot itself in the group, reports and updates occur unnoticed by users\n\n# How to Set Up the bot in Your Group\nHow to connect the bot @Moderator_Helper_Robot (or your own instance) to your group:\n\n1. Add the bot to your group.\n2. Grant it admin privileges (with ban and add member permissions).\n3. Run the command /update in the group (or /update@Moderator_Helper_Robot if there are other bots with similar commands in the group).\n4. The bot will start working. All admins must open a chat with the bot so it can send them notifications.\n\n# Installing a .deb package (your own service instance)\nIf you want to run your own instance instead of the public bot, you can install the Debian package and configure the daemon as a system service.\n\n1. Install required packages:\n   ```bash\n   sudo apt-get update\n   sudo apt-get install -y mariadb-server jq openssl\n   ```\n2. Install tgadmin package:\n   ```bash\n   sudo dpkg -i ./tgadmin_\u003cversion\u003e_amd64.deb\n   ```\n3. Edit the bot config and set Telegram credentials:\n   ```bash\n   sudoedit /etc/tgadmin/tgadmin.json\n   ```\n   Fill in at least:\n   - `AdminHelperBot.Telegram.Token`\n   - `AdminHelperBot.Telegram.UserName`\n   - `ServiceAdmin` (Telegram user id of service owner/admin)\n4. (Optional) Run service under a custom Linux account by editing:\n   ```bash\n   sudoedit /etc/default/tgadmin\n   ```\n   Supported keys:\n   - `TGADMIN_SERVICE_USER`\n   - `TGADMIN_SERVICE_GROUP`\n5. Enable and start the service:\n   ```bash\n   sudo systemctl daemon-reload\n   sudo systemctl enable --now tgadmin\n   sudo systemctl status tgadmin --no-pager\n   ```\n6. If database bootstrap was skipped during installation, run:\n   ```bash\n   sudo dpkg-reconfigure tgadmin\n   ```\n\nUseful paths:\n- Service unit: `/lib/systemd/system/tgadmin.service`\n- Runtime config: `/etc/tgadmin/tgadmin.json`\n- Service identity override: `/etc/default/tgadmin`\n- Data directory: `/var/lib/tgadmin`\n- Logs directory: `/var/log/tgadmin`\n\n# Spam classifier\nA spam classifier has been added to the bot (you can turn it off in the service config), \nwhich can be trained and used to automatically notify administrators (and in the case of high spam probability can be automatically to ban) about suspicious messages. \nThe algorithm of the Naive Bayesian Classifier is used. \nIn addition, messages in which the number of emojis exceeds the specified number can also be automatically marked as spam by this filter\n\n# Architecture\nThe software implements the telegram bot as a web server in webhook mode\n\n# Dependencies\n- fp-telegram (Telegram bots API wrapper) https://github.com/Al-Muhandis/fp-telegram\n- brook-telegram (Plugin for BrookFoFreePascal) https://github.com/Al-Muhandis/brook-telegram/\n- BrookForFreePascal \u0026 BrookFramework (HTTP server) https://github.com/risoflora/brookfreepascal \u0026 https://github.com/risoflora/brookframework\n- dOPF (ORM) https://github.com/pascal-libs/dopf\nNotes: BrookFreePascal can be used without BrookFramework in broker mode\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal-muhandis%2Fadminhelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal-muhandis%2Fadminhelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal-muhandis%2Fadminhelper/lists"}