/Mario's bots

Blocklist

A shared blacklist: ban someone once and they are gone from all your groups.

What it does

Blocklist keeps a blacklist of users that applies to every group where the bot is an admin. When someone on your staff puts a person in the blocklist, the bot bans them everywhere: in the groups you have now and in the ones you will add tomorrow. You do not have to repeat the ban group by group.

Every ban can carry proofs (the messages that triggered the report, forwarded to the bot) and a category, for example spam, scam or fraud. Proofs stay archived and can be read again at any time with /prove.

There is no public Blocklist to use as it is: the bot is used cloned, because the blacklist, categories, groups and staff are yours and you share them with nobody.

The bot speaks English and Italian. It follows the language of your Telegram app (Italian for any language other than these two); you can change it at any time with /language. Messages the bot sends without anyone asking, such as ban notices in groups and the daily permission warnings, use the language of the clone's owner.

Before you start

You need all of this:

Details on how to promote a bot are in Telegram permissions.

Setup

  1. Create your clone following Create your own clone, then open it and send it /start.
  2. Create the staff group, add the bot and promote it to admin with the permission to ban.
  3. From the staff group send /setstaff. The bot replies "Staff group set successfully." From then on the admins of that group are the bot admins: whoever you promote there controls the bot, whoever you demote loses the commands.
  4. If the staff group is a forum, send /setstaff inside the topic you want to use. Only that topic counts as the staff chat.
  5. Add the bot to the groups to protect and promote it to admin with the permission to ban.
  6. Optional: create categories with /addcategory and /addmandcategory, then in each group choose which ones to enable with /setcategories.
  7. Optional: add with /addbakchat a group where proofs are archived, so they stay readable even months later.

Commands

For everyone

CommandWhat it doesWhoWhere
/info 123456789Tells whether that person is in the blocklist, since when and why. Accepts @username tooeveryoneprivate chat
/statusTells you whether you are in the blocklist and whyeveryoneprivate chat
/reportIn reply to a message, sends it to the staff with the author's detailseveryonein groups
/supportCalls the staff. In reply to a message it behaves like /reporteveryonein groups
/languageSwitches the bot between English and Italianeveryoneprivate chat
/cloneExplains how to create your own copy of the boteveryoneprivate chat

Managing the blocklist

CommandWhat it doesWhoWhere
/bl 123456789 reasonStarts the guided ban of a person: category, proofs, confirmation. Also works in reply to one of their messagesbot adminstaff chat or private chat
/mbl 123456789 987654321Like /bl but for several people at oncebot adminstaff chat or private chat
/nban 123456789 reasonBans right away, without asking for proofsbot adminstaff chat or private chat
/snban 123456789 reasonLike /nban, but without a notice in the groupsbot adminstaff chat or private chat
/unbl 123456789Removes from the blocklist and unbans everywherebot adminstaff chat or private chat
/prove 123456789Forwards you the archived proofs for that personbot adminstaff chat or private chat
/escilo -1001234567890 messageMakes the bot leave that group, with an optional goodbye messagebot adminstaff chat or private chat

With /bl and /mbl the bot replies with the Open private chat button: the rest of the procedure (category, proofs, confirmation) happens there, so the proofs do not end up in front of everyone.

/nban accepts several IDs and several reasons together: /nban 111 222 333 | spam - scam gives each one a different reason, and if a reason is missing the last one written applies.

Categories

CommandWhat it doesWhoWhere
/addcategory spamCreates an optional category, which each group enables if it wantsbot adminstaff chat or private chat
/addmandcategory scamCreates a mandatory category, always active in every groupbot adminstaff chat or private chat
/delcategory spamDeletes a categorybot adminstaff chat or private chat
/listcategoriesLists the categories, with the mandatory ones in boldbot adminstaff chat or private chat
/setcategoriesOpens the menu to turn the optional categories on or off in that groupgroup adminin the group

In the /setcategories menu โ˜‘๏ธ marks a mandatory category, which you cannot touch, โœ… an active optional one and โŒ an optional one turned off. Tap โœ”๏ธ Close when you are done.

Configuration

CommandWhat it doesWhoWhere
/setstaffRegisters the current group (or topic) as the staff chatbot adminin the staff group
/unsetstaffRemoves the staff chatbot adminanywhere
/setsupport assistCreates a second name for /support, for example /assistbot adminanywhere
/unsetsupportRemoves the alternative namebot adminanywhere
/setidcmd verifyEnables /id, with which an admin declares themselves an official bot admin, and gives it a second name, for example /verifybot adminanywhere
/unsetidcmdDisables /idbot adminanywhere
/setbanfooter For help write /supportAdds a line at the bottom of the ban message, for example where to ask for helpbot adminanywhere
/unsetbanfooterRemoves the line from the ban messagebot adminanywhere
/setidfooter <text>Adds a line at the bottom of /id repliesbot adminanywhere
/unsetidfooterRemoves the line from /id repliesbot adminanywhere
/addadmin 123456789Adds a bot adminbot adminanywhere
/deladmin 123456789Removes a bot admin. Only needed if you have no staff chatbot adminanywhere
/listadminsLists the bot adminsbot adminanywhere
/addbakchat -1001234567890 12345Registers a chat where proofs are archived. With no arguments it uses the current chatbot adminanywhere
/delbakchat -1001234567890Removes an archive chat. With no arguments it removes the current onebot adminanywhere
/listbakchatsLists the archive chatsbot adminanywhere
/refreshChecks again the groups where the bot was not an admin and updates the situationbot adminprivate chat

Lists and statistics

CommandWhat it doesWhoWhere
/listablLists who is in the blocklist, in pagesbot adminstaff chat or private chat
/listaxlsxSends the same list as an Excel filebot adminstaff chat or private chat
/importabl @oldbotCopies into this bot the blocklist of another blocklist bot, even if that bot was deleted. With no arguments it shows which bots you can import from. Bans already present stay as they areadmin of both botsstaff chat or private chat
/contablCounts the people in the blocklist, split by categorybot adminstaff chat or private chat
/listchatsLists the groups the bot is inbot adminstaff chat or private chat
/contachatCounts the groups and channels the bot is inbot adminstaff chat or private chat
/stat 123456789Shows how many chats are really operational and how many bans are still to apply. With a person or group ID it narrows the countbot adminstaff chat or private chat
/staff -1001234567890Lists the admins of that group by rolebot adminstaff chat or private chat
/statsHow many times the bot was cloned and how many chats it is inbot adminprivate chat
/helpSummary of the commandsbot adminanywhere

The /stat summary is computed in the background and shows the time of the last update. The first time the bot replies to try again in a few minutes.

Buttons and automations

The ban is not instant everywhere. The bot runs it through a queue, group by group: if you have many chats a few minutes may pass before the person is out of all of them.

When you add the bot to a new group, it checks the blocklist right away and bans whoever is already inside. Mandatory categories are enabled by themselves in that group, optional ones you choose.

During the /bl and /mbl flow the โŒ Delete all messages button appears. If you turn it on, at ban time the bot also deletes the messages that person left in the groups. Tap Finish when you are done sending proofs.

If someone adds, promotes or removes the bot from a group, the staff chat gets a notice with who did it, where, and which permissions were granted.

Once a day the bot checks it is still an admin everywhere. Where it is not, it writes in the group: "The bot is not added as admin or it can't ban". If after three days nothing changes, it leaves by itself.

Frequently asked questions

I banned a person but they are still in a group.

Wait a few minutes: bans are applied through a queue. If nothing changes after that, the bot lacks the ban permission in that group. Check with /stat, which tells you how many chats are operational and how many bans are still missing.

The bot did not delete the old messages.

Telegram gives bots 48 hours to delete other people's messages. After that nobody can remove them anymore, not even you.

Who are the bot admins?

If you set a staff chat with /setstaff, they are the admins of that chat: you manage them from Telegram, by promoting or demoting people there. Without a staff chat you add them by hand with /addadmin, and in that case /addadmin and /deladmin are the only ways.

Someone tells me they cannot get in, how do I check?

Have them send /status to the bot in private: it will tell them whether they are in the blocklist, since when and why. On your side you can use /info with their ID or username. Both commands are open to anyone, no permissions needed.

The bot tells me it lacks permissions.

It means that in that group it is not an admin, or it is but without the permission to ban users. The message also tells you how many days are left before the bot leaves: after three warnings it leaves the group.

What are mandatory categories for?

They are for things that are not up for debate, for example fraud: they apply in every group and no group admin can turn them off. Optional categories instead are turned on by whoever wants them, group by group, with /setcategories.

Where do the proofs go?

They stay in the bot's archive and you read them again with /prove. If you register an archive chat with /addbakchat, the bot copies the messages used as proof into it, so they stay safe even if the original chats disappear.

Create your own clone