/Mario's bots

Master Control Program

Advanced group administration: automatic bans on suspicious profiles, antispam, mass mute and timed deletion.

What it does

Master Control Program is the administration bot for large groups, the ones where spam profiles come in waves and nobody wants to check them one by one. Its strong point are specialbans: you describe what an unwanted profile looks like (name, bio, language, age, personal channel) and the bot bans on its own anyone who matches, as soon as they join or as soon as they write.

Around that sit the chores of every group: deleting service messages, stripping the "forwarded from" header from messages reposted from channels, limiting how many links a day a person can send, muting newcomers until an admin unlocks them, banning people who keep joining and leaving, deleting media after a few hours, finding inactive members.

Every setting is managed with /msettings, a button panel that shows how the group is configured right now. The written commands remain valid and do exactly the same things: use whichever is more comfortable.

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 or the ๐ŸŒ Language button in the panel. Messages the bot writes in the group by itself use the language of the person they are about.

Before you start

The bot is used in groups (it also works in supergroups with topics). In private only the information commands answer.

It must be added to the group and promoted to admin. The Telegram permissions it needs:

If you want the log channel, the bot must be an admin there too. Details in Telegram permissions.

Setup

  1. Add the bot to the group and promote it to admin with the permissions above.
  2. Write /msettings in the group: the panel with every setting opens.
  3. Turn on what you need by tapping the buttons. Entries with a value (Automute, Leave ban, Spam limit, timed deletion hours) cycle through the possible values at every tap.
  4. Open Specialbans and add the first rules. The panel guides you by category: Name, Bio, Language, User age, Personal channel.
  5. If you want to keep track of what the bot does, create a channel, add the bot as admin, then write /canalelog in the group and forward to the channel the message the bot gives you. Confirm with Yes.
  6. Exclude from the automations the people who must stay out of them (service bots, editors who forward from channels) with the exclusion commands.

Commands

Information

CommandWhat it doesWhoWhere
/startWelcome messageeveryoneprivate
/helpPoints to the guide and suggests cloningeveryoneprivate and group
/languageSwitches the bot between English and Italianeveryoneprivate and group
/cloneInstructions to create your own cloneeveryoneprivate and group
/pingReplies PONG, useful to see if the bot is aliveeveryoneprivate and group
/infoID, language and datacenter of a person (in reply, with @username or with the ID)everyoneprivate and group
/dcOnly the datacenter, derived from the profile photoeveryoneprivate and group
/search_id @userHistory of that person's names and usernameseveryoneprivate
/testHow many members the group haseveryoneprivate and group
/statsHow many clones and how many chats the bot manageseveryoneprivate and group

Settings panel

CommandWhat it doesWhoWhere
/msettingsOpens the button panel with every chat settinggroup admingroup
/mimpostazioniThe same panel, with the Italian namegroup admingroup

Automatic moderation

CommandWhat it doesWhoWhere
/delserviceDeletes service messages (joins, leaves, photo changes)group admingroup
/undelserviceStops deleting themgroup admingroup
/disinoltraReposts messages forwarded from channels without the header, and says who sent themgroup admingroup
/undisinoltraTurns the unforwarding offgroup admingroup
/silentThe bot stops announcing in chat what it doesgroup admingroup
/unsilentGoes back to announcing itgroup admingroup
/sfissadiscussioneUnpins by itself the posts forwarded from the linked channelgroup admingroup
/unsfissadiscussioneStops unpinning themgroup admingroup
/uscitiban 2Bans whoever leaves the group the given number of times (no number means 1)group admingroup
/unuscitibanTurns off the leave ban and resets the countgroup admingroup
/automuteMutes newcomers until an admin unlocks themgroup admingroup
/automutemediaNewcomers can write text but not send mediagroup admingroup
/unautomuteTurns off the mute on joingroup admingroup
/setspamlimit 10Daily limit of forwards and Telegram links (invites and @username of groups or channels) per person, past which the message is deletedgroup admingroup
/unsetspamlimitRemoves the limit and resets the countsgroup admingroup
/specialbansLists the specialban rules active in the groupgroup admingroup
/specialban bioparziale onlyfansAdds a specialban rulegroup admingroup
/unspecialban bioparziale onlyfansRemoves that rulegroup admingroup
/setspecialbanreplymessageIn reply to a media, saves it: the bot will send it after every specialbangroup admingroup
/unsetspecialbanreplymessageRemoves the saved mediagroup admingroup
/setuscitibanreplymessageThe same, for the leave bansgroup admingroup
/unsetuscitibanreplymessageRemoves the saved mediagroup admingroup

Exclusions

Every automation can be turned off for a single person. The command works in reply to one of their messages, with @username or with the numeric ID.

CommandWhat it doesWhoWhere
/specialbanescludi @userThat person will never be banned by the specialban rulesgroup admingroup
/unspecialbanescludi @userRemoves the exclusiongroup admingroup
/disinoltraescludi @userTheir forwards from channels stay as they aregroup admingroup
/undisinoltraescludi @userRemoves the exclusiongroup admingroup
/spamlimitescludi @userThe daily limit does not apply to themgroup admingroup
/unspamlimitescludi @userRemoves the exclusiongroup admingroup
/uscitibanescludi @userThey can join and leave as much as they like without being bannedgroup admingroup
/unuscitibanescludi @userRemoves the exclusiongroup admingroup

Manual moderation

CommandWhat it doesWhoWhere
/listmutedLists every member with active restrictionsgroup admingroup
/kmuteKicks every muted member out of the groupgroup admingroup
/allmuteMutes every member who is not an admin or a botgroup admingroup
/allunmuteGives the voice back to every muted member who is not an admingroup admingroup
/minattivi 30Looks for people who have not written for that many days (no number, 20) and offers to kick or ban themgroup admingroup
/addtitle @user ModeratorGives an admin a custom titlegroup admingroup
/deltitle @userRemoves admin rights, title includedgroup admingroup

Timed deletion

CommandWhat it doesWhoWhere
/setdickcmd evening nightDefines the words that mark a media for deletion. With no words, turns the feature offgroup admingroup
/setdickhours 2.5After how many hours to delete (2.5 means two and a half hours)group admingroup

Whoever sends a media writes #evening in the caption, or replies to their own media with /evening. To change the time for that media only, write #evening1h or #evening30m.

Unsplash

CommandWhat it doesWhoWhere
/enableunsplashEnables /unsplash in the groupgroup admingroup
/disableunsplashDisables itgroup admingroup
/unsplash phrase to useTurns the phrase into a quote-style image. In reply to a message it uses that message's texteveryoneprivate, and in groups where it is enabled

Log

CommandWhat it doesWhoWhere
/canalelogExplains how to link the log channel and gives you the message to forwardgroup admingroup
/setlogchannelIt is the message to forward to the channel: it starts the confirmation requestgroup adminin the log channel

Specialban rules

A rule tells the bot what a profile to ban looks like. Add them with /specialban <type> <value>, or from the panel, which asks the same things as questions. Rules apply only in the group where you write them.

TypeWhat it bansExample
nomeThe first name, or first and last name together, is exactly that text (case does not matter)/specialban nome Anna
nomeparzialeThe name contains that text as a whole word, case-insensitive: escort does not catch escortgirl/specialban nomeparziale escort
nomealfabetoThe name contains characters of an alphabet: ARABIC, CYRILLIC, GREEK, HEBREW, LATIN/specialban nomealfabeto CYRILLIC
nomewildcardThe name matches a pattern with the asterisk as wildcard/specialban nomewildcard *bitcoin*
langThe person uses Telegram in that language (two-letter code)/specialban lang ru
bioThe bio is exactly that text (case does not matter)/specialban bio looking for friends
bioparzialeThe bio contains that text as a whole word/specialban bioparziale onlyfans
bioalfabetoThe bio contains characters of that alphabet/specialban bioalfabeto ARABIC
biotemplateThe bio falls in a ready-made category: LINK (any link), TELEGRAMLINK (Telegram link), CAM (cam profiles)/specialban biotemplate CAM
biowildcardThe bio matches a pattern with the asterisk as wildcard/specialban biowildcard *t.me/*
ageThe age stated in the profile is below that number of years/specialban age 18
channelThe person has a personal channel linked to the profile. Takes no value/specialban channel

Rules on name and language apply right away. The ones that look at the bio, the age and the personal channel need to read the full profile, which Telegram allows at a limited rate: a few seconds of delay is normal. The age rule only works if the person has set their birthday in the profile.

To remove a rule use the same type and the same value (/unspecialban bioparziale onlyfans), or the bin icon next to the rule in the panel.

Buttons and automations

When someone joins the group, the bot checks them against the specialban rules. If a rule matches, it bans them, deletes every message it has already seen them write, sends the media you saved with /setspecialbanreplymessage and writes what happened in the log channel. The check also runs on normal messages, so it also catches people who were already inside before the rule existed, or who change name and bio after joining.

The /msettings panel is all buttons: the green tick or the cross shows whether a setting is on, entries with a number cycle through the available values at every tap, and the Timed delete and Specialbans sections open in a submenu. Specialban rules are added there by answering questions, and deleted with the bin icon.

/minattivi replies with the list of inactive members and two buttons, Kick all and Ban all. The list arrives in private, so the chat with the bot must already be open: if the bot cannot write to you, it gives you a button to open it. If the list is too long for one message, the bot sends a link to the full text.

In the log channel, the bot adds by itself the datacenter of whoever joined to the join messages, and highlights those outside Europe.

The rest works without commands: service messages disappear, forwards from channels are reposted clean, whoever exceeds the daily limit gets the message deleted with a notice, newcomers are muted, marked media disappear when time runs out.

Frequently asked questions

Commands or panel?

The panel, because it shows you how the group is set up now. Commands are for when you already know what you want, or when you need to set something the panel does not ask, like a long regular expression or an admin title.

I added a rule but the spam profiles are still inside

Rules do not clean the group by themselves. They apply to whoever joins and whoever writes: profiles already inside that stay silent are not touched.

The bot does not ban

Check the Ban users permission. If the permission is there, look whether the person is among the exclusions (/specialbanescludi shields them from every rule) or is an admin: admins are never touched by the automations.

Why does it not delete old messages?

Telegram lets a bot delete other people's messages only within 48 hours. That applies to the timed deletion of media and to the cleanup after a ban.

The log channel stays empty

The bot must be an admin in the channel, with permission to post, and the link must be confirmed with the Yes button that arrives in the group after forwarding the /setlogchannel message.

/unsplash does not work in the group

It has to be enabled once per group with /enableunsplash. In private with the bot it always works.

Is cloning worth it?

Yes. A clone dedicated to your group does not share Telegram's rate limits with every other chat, so bans and deletions arrive sooner.

Create your own clone