Warning
The bot is in maintenance mode. New features will most likely not appear
Some random TypeScript bot with interesting features based on the grammY library
Note
This bot was created as an additional tool to fight against premium Telegram stickers and emoji (Because they sucks)
Live instance of bot: @antipremiumbullshit_bot
- Removes premium stickers/emojis (Can be disabled/enabled with special command)
- Removes voice/video messages (Can be disabled/enabled with special command)
- Handy white/ignore lists configuration from DM
- Locale configuration via commands
- and more... (maybe)
- Create a new bot and get a bot token
Note: Don't forget to disable privacy mode for your bot.
For more information about how this does not violate the privacy of users conversations, read the FAQ section
- Install
redis-cli
anddeno
- Clone this repository
- Open an
.env
file in the root of the folder and change variables into it:BOT_TOKEN
- bot tokenCREATOR_ID
- your ID for working with the bot whitelist/ignored list from the DM
- Run
deno task dev
If you want to get all debug data, run
export DEBUG="grammy*"
before launching bot - Wait for
Started as @...
message and/or message in PM from bot - Bot is ready to go!
- Create a new bot and get a bot token
- Create a new Redis database and get: Username, Password, Host and Port
How to create a Redis database, create a user and get the necessary data to connect will not be written here
- Refer to Fly for Dockerfile documentation for creating app, setting up secrets and deploying
Which secrets need to be set can be found below in Heroku section, step 3
- Wait for
Started as @...
message in console and/or message in PM from bot - Bot is ready to go!
- Create a new bot and get a bot token
- Create a new Redis database and get: Username, Password, Host and Port
How to create a Redis database, create a user and get the necessary data to connect will not be written here
- Create a new pipeline in Heroku, the application in it and set neccessary config vars in the settings:
BOT_TOKEN
- bot tokenCREATOR_ID
- your ID for working with the bot whitelist/ignored list from the DM (better to pass, as bot won't work correctly without it)CHATS_TABLE_NAME
- name of table with data in Redis DBREDISUSER
- name of Redis DB userREDISPASS
- password of Redis DB userREDISHOST
- endpoint of Redis DBREDISPORT
- port of Redis DB endpoint
- Push sources on Heroku (or set up auto-deployment) and wait for build
- Wait for
Started as @...
message in console and/or message in PM from bot - Bot is ready to go!
While doing step 3, refer to Heroku Docker Docs for converting the stack into a container
Tip
If something doesn't work, check the application logs in Heroku or locally and try googling the problem. If nothing helps, open an Issue with a detailed description of the problem
Group commands:
help
- send help messagesilent
- manage bot silent modeaidenmode
- enables "Aiden Pierce" mode (Removes voice/video messages)aidensilent
- manage "Aiden Pierce" silent modenoemoji
- triggers emoji strictness removaladminpower
- triggers ignoring of restricted messages from adminssilentonlocale
- change message when silent mode is enabledsilentonlocalereset
- reset message when silent mode is enabledsilentofflocale
- change message when silent mode is disabledsilentofflocalereset
- reset message when silent mode is disabledmessagelocale
- change message when bot removes stickersmessagelocalereset
- reset message when bot removes stickers
DM commands:
help
- send DM help messageaddwl
- add group ID to white listremwl
- remove group ID from white listsilentremwl
- remove group ID from white list without notificationgetwl
- get all groups info from white listaddil
- add group ID to ignore listremil
- remove group ID from ignore listgetil
- get all groups ID from ignore listgetcmdusage
- get counters of commands usageimport
- import database entries to the related Redis instanceexport
- export database entries from the related Redis instanceuptime
- get current uptime of bot
The entire locale strings are now stored in the src/locales
. Some strings can be changed per chat using the commands above with locale
substring in it.
The project now has a separate file CHANGELOG.md. Check it for details
Q: How white/ignore lists are working?
When the bot is added to an unknown group, you will be prompted to add the group to the whitelist, decline the offer to add, or add it to the ignore list. The ignore list is used to prevent the bot from sending you information about future additions to the group that you have set to the ignore list. In the case of a simple rejection, the bot will not work in the new chat until you add it to the whitelist
Q: Why were these lists added in the first place?
During the tests, it became clear that with limited resources (small database memory, low system configuration, etc.), the best solution was to limit the number of chats, for less load on the infrastructure of the bot. If you want, whitelist can be cut out of the code, perhaps later will be created a separate branch for this, but not for sure
Q: Is the privacy of conversations with the privacy mode disabled violated?
No, it is not violated. The advantage of this bot is that it:
- Does not log messages received from the Telegram API
- Processes only stickers, emojis and voice/video messages, thanks to a convenient filter provided by the grammY library. If you want to make sure of this, look at the folder with handlers
This repository is licensed under MIT License