A Telegram bot as group admin applying 啊 (ah) policy to the group.
Join @AhAhAhGroup to see how it works.
The bot should be set as group admin so that it can delete any message that violate the policy. Messages on private chat will be ignored.
- User can only post:
- Plain text constituted with one or more 啊; or
- A few allowed stickers
- No double posting
- No editing
- No links
- No bot
- The number of 啊 on single post is at most it in the last post plus one
- Except
啊
,啊啊
,啊啊啊
, and stickers, which can be posted at anytime - Allowed stickers is treat as single 啊
- Except
New member of a group should send at least one message containing 啊 or allowed stickers in their first few messages, otherwise they will be banned by the bot.
Members already in the group before the bot join and members who has posted at least one allowed message would never be banned regardless the number of disallowed messages they sent.
Save bot token as a file at $CREDENTIALS_DIRECTORY/token
.
Optional environment variables:
CREDENTIALS_DIRECTORY
- Where to readtoken
file, default to current working directory.STATE_DIRECTORY
- Where to store bot state, default to current working directory.RUST_LOG
- Adjust log level, see env_logger.
- teloxide: An elegant Telegram bots framework for Rust
telegram-bot was used but has been replaced by teloxide due to lack of maintenance.
- HEX Counter (Sodium-Aluminate/CountTo0xffffffff)