An Engineer’s perspective
In our recent article about dealing with The FUD we talked about the DADI Helper Bot and the important role it played in reducing the unnecessary, pervasive and offensive noise in one of our most important channels.
This article is for those that want to know exactly what was going on under the hood, and what we learned dealing with exponential community growth.
@DADIHelperBot started out as a pretty basic Node.js application utilising Telegraf to interact with Telegram’s Bot API. Between the 15th January and the 28th Febuary there were 94 commits to the bot’s codebase, all relatively substantial in size.
The first build did very little. It offered a few slash commands, including /admins which, as you’d expect, listed the current group admins. This might seem trivial, but by that point in time we’d already had a handful of reports of members being messaged by fake admins using our names and profile pictures in attempts to lure innocent participants into handing over Ethereum to unofficial wallet addresses. By adding the command, and advising members to only initiate conversations with admins by clicking on their names in the list, we hoped to reduce the number of instances of fraud.
The bot started blocking all images, videos and audio messages as well as bad language and Ethereum addresses. This started out as a couple of simple regular expressions:
const abusiveWord = /(fuck|shit|twat|bollocks|farage)/gi
const hexRexExp = /(\[0|O\]x)?\[a-fA-F0-9\]{40}/gmiAs admin fraud increased, we realised that a lot of the fake admins were entering the channel, gathering a handful of active users and exiting unnoticed. We puzzled over how best to automate the identification and removal of scammers, and settled on a rather complex routine of image matching. Using the event handler, the bot would now download the entire historic profile image library for a user, and compare those images to those of our community admins. We tried a few image comparison libraries before choosing . Now that the bot was able to detect and kick based on images, we topped it off with a little name comparison detection. For this, we used .
Knowledge
Last Updated:
September 2019

