MozIta Antispam icon

MozIta Antispam (@mozita_antispam_bot) guarded the official Mozilla Italia Telegram groups. New members could not post until they had read the rules and another verified member had confirmed them. Spam accounts were kicked and banned from every enabled group at once, and the bot could also filter banned words. Admins managed the shared user lists, banned words, enabled groups, broadcasts and log downloads through text commands in a private chat with the bot. It was written in Python 3 with the telepot library.

Type Telegram bot
Platforms Telegram
License Open source
Latest version v1.6.5
Active 2018 – 2020 · 2 years
Role Creator and lead developer, with contributions from the Mozilla Italia community

Changelog

v1.6.5 20 June 2020

Quick fix: the bot works in supergroups again, not only in basic groups and private chats.

v1.6.4 14 June 2020

The bot now acts only in private chats and groups (not in channels, for example), and it now handles pinned-message events, contributed by Damiano Gualandri (dag7dev).

v1.6.3 12 June 2020

Polls are now accepted events (contributed by Damiano Gualandri), plus typo and indentation fixes.

v1.6.2 15 April 2020

Fixed messages being reported as unrecognised when they contained a user mention (issue #22, contributed by marcodenisi).

v1.6.1 7 April 2020

Fixed GIF detection (#20) and improved error logging.

v1.6 26 March 2020

After reading the rules, a new member now has to wait at least 30 seconds before anyone can confirm them (#16, contributed by Ilyas).

v1.5 28 January 2020

Bug fixes and an updated icon (#17).

v1.4.13 26 November 2019

The bot now answers inline-button presses, which fixes the endless loading indicator (issue #14), and shows feedback messages on buttons.

v1.4.12 16 November 2019

Fixed the welcome message showing up for users who were already verified and not showing up for users added by someone else. The admin alert 'Cacciato' is now 'Utente rimosso'.

v1.4.11 21 October 2019

Admins can download log files straight from the bot. The admin command list is clearer and the code was improved.

v1.4.10.2 6 September 2019

Updated the rules link and added a 'Read the full rules' button to the confirmation message.

v1.4.10.1 22 July 2019

Users waiting for confirmation can now send stickers and GIFs as well as text.

v1.4.10 1 June 2019

Fixed a bug: users on the spam list no longer get a welcome message when they rejoin.

v1.4.9 15 May 2019

Fixed the 'removed' and 'blocked and removed' events both firing at the same time.

v1.4.8 14 May 2019

Fixed a problem with handling users blocked through the 'Block user' button.

v1.4.7 10 May 2019

Fixed handling of users who are not on any list yet. Their messages are now deleted.

v1.4.6 5 May 2019

Improved how users are blocked and removed (/bloccautente).

v1.4.5 5 May 2019

Improved the user confirmation flow for both 'Show rules' and 'Confirm user', and updated the exceptions list.

v1.4.4 4 May 2019

The bot no longer posts a message in the group when a user is removed.

v1.4.3 23 April 2019

Added a check to the user-blocking procedure.

v1.4.2 23 April 2019

Fixed a problem with the 'Block user' button.

v1.4.1 15 April 2019

Small changes to 1.4.0.

v1.4.0 15 April 2019

New /benvenuto command to show the welcome message again. Blocked users can report a possible mistake once, through a private chat with the bot.

v1.3.9 13 April 2019

Fixed a syntax error introduced in 1.3.8.

v1.3.8 12 April 2019

Bug fix for the admin 'invia messaggio' (broadcast) command. The messages file was reformatted with indentation (contributed by Damiano Gualandri).

v1.3.7 22 March 2019

Updated the bot's messages (frasi.json) and renamed some variables.

v1.3.6 19 March 2019

Code-quality improvements: the Pylint score went from 2.92 to 7.09 out of 10.

v1.3.5 17 March 2019

Bug fix: button presses from new or unverified users are no longer handled as regular messages.

v1.3.4 17 March 2019

Fixes to the bot and to the telegram_events module.

v1.3.3 17 March 2019

Various fixes. The telegram_events module was updated to 1.1.

v1.3.2 16 March 2019

Fixed a bug in the new message-deletion function.

v1.3.1 16 March 2019

Code split into functions and commented. The banned-words filter was switched off after a community poll.

v1.3.0 9 March 2019

Message-event detection moved into a new reusable module, telegram_events.py. Giovanni Francesco Solone revised the bot's texts.

v1.2.6 8 March 2019

Bug fix.

v1.2.5 8 March 2019

The welcome and 'rules read' messages are now deleted when someone presses their buttons (show rules, confirm user, block user).

v1.2.4 8 March 2019

Various fixes.

v1.2.3 8 March 2019

Removed the test commands and added private-chat admin commands to show or clear the white, black, temp and spam lists.

v1.2.2 8 March 2019

Usernames in the bot's messages are now clickable mentions shown with the user ID.

v1.2.1 8 March 2019

The bot's messages and button labels now live in an editable frasi.json file.

v1.2.0 21 February 2019

Messages now use HTML formatting instead of Markdown, and the welcome message has a new 'Block user' button.

v1.1.9 20 February 2019

Added some test commands for admins in private chat.

v1.1.8 19 February 2019

Messages with banned words are now deleted with a warning instead of the sender being banned. Admins get private alerts when a user is removed or uses banned words.

v1.1.7 17 February 2019

Chat history is now saved as daily log files in the history_mozitaantispam folder.

v1.1.6 17 February 2019

Removed the IRC-bot check, which did nothing because bots cannot see other bots' messages, and fixed some problems.

v1.1.5 11 February 2019

Fixed an error introduced in 1.1.4.

v1.1.4 11 February 2019

Handles group-photo changes and tells apart users who join or leave from users who are added or removed. Other small fixes.

v1.1.3 5 February 2019

Small update: the confirmation message now links to the rules.

v1.1.2 2 February 2019

Admins can see the version and last-update date by sending /help in private chat.

v1.1.1 2 February 2019

Bug fix.

v1.1.0 2 February 2019

Users without a Telegram username are no longer kicked. They are identified by their user ID instead. Bot messages now support Markdown.

v1.0.3 1 February 2019

Added emoji and made minor fixes.

v1.0.2 31 January 2019

Spelling fix in the welcome message.

v1.0.1 27 January 2019

First 1.x version. It prints the version and last-update date at startup.

v0.3.6 alpha 19 January 2019

Verified users without a username are no longer banned, and the removal message is clearer. Forbidden messages coming from the IRC bridge bot are deleted without a ban.

v0.3.5 alpha 18 January 2019

Stickers now go through the banned-words filter using their emoji. The bot token moved to a config.ini file.

v0.3.4 alpha 17 December 2018

Private chats and non-enabled groups are now told apart. Added an ECCEZIONI.md list of handled exceptions and an icon, and renamed the main file to antispam_mozita.py.

v0.3.3 alpha 4 December 2018

Small fix: users without a username are handled separately from spam users.

v0.3.2 alpha 4 December 2018

Added a small check and updated the welcome messages.

v0.3.1 alpha 25 November 2018

Fixed some errors, handled some exceptions, and private chats are now logged too.

v0.3.0 alpha 25 November 2018

Finished the admin commands: manage users, banned words and enabled groups, and send a message to every enabled group. Users without a username are banned automatically.

v0.2.1 alpha 24 November 2018

Fixed list import and export. The spam-list check now runs first, and join/leave messages are always shown.

v0.2.0 preview 24 November 2018

Lists are now imported from and exported to JSON files.

v0.1.1 preview 22 November 2018

Edited messages and replies are now marked. The bot tells enabled groups apart from private chats, and the first manual controls for admins were added.

v0.1.0 preview 20 November 2018

Added the AdminList, WhiteList, BlackList, TempList and SpamList. Members must read the rules before they can be confirmed. Also added a banned-words filter, chat-history logging and per-group welcome messages.

v0.0.2 preview 16 November 2018

Added the 'Confirm user' procedure. Only new members get the welcome message, and messages from unverified users are deleted automatically.

v0.0.5 preview 16 November 2018

Early preview: the bot deletes messages from unverified users, bans spam users and welcomes new members.

v0.0.1 preview 15 November 2018

First code of the antispam bot.