Slide 1

Slide 1 text

Sweetie Bot ANTI-SPAM BOT FOR DISCORD

Slide 2

Slide 2 text

Introduction Erik McClure aka Cloud Hop From Redmond, Washington Worked at Microsoft for 16 months Made Pony Clicker (for some reason) Sometimes writes music and fanfiction http://cloudhop.horse

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Discord  A new chat and voice client for gamers that emerged in late 2015.  Way better than Skype in almost every way  Then again, Skype sets a bar somewhere beneath the Mariana Trench.  Deals with large groups much better than Telegram  Is now being used as a replacement for IRC chatrooms

Slide 5

Slide 5 text

Problem  Early in Discord’s history, there was no official bot API or rate limiting.  Our chatroom was targeted by trolls and “raided”  This usually meant spamming lots of 卐卐卐卐卐  This could actually crash the client  At the time, DiscordGo was one of the few API libraries out there  So I wrote an anti-spam bot using the unofficial API

Slide 6

Slide 6 text

Evolution  Discord eventually supported an official Bot API and introduced rate limiting  However, they introduced an @everyone ping, and it was a simple text-search  There was no separate “don’t let people ping everyone” role  Even after this was fixed, spammers started individually pinging everyone on the entire user list  Now they’re spamming friend invites too, which are impossible to detect  As discord grew, the API became more decentralized and introduced more spurious errors  Exploitation of the platform has gotten so bad, some larger servers have been raided with over 300 bots at the same time.  The API still isn’t very well documented, and Sweetie Bot must contend with harsh rate limits.  Also, Discord’s abuse team asks you to not delete the messages you’re trying to report?!

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Writing in Go

Slide 9

Slide 9 text

Pressure System  Originally only checked for n messages in m seconds.  This worked until rate limiting forced them to adapt.  Pressure system is a decaying heat based system.  Unlike Fimfiction’s heat system, uses a linear decay rate.  This turns out to model real conversations the best.

Slide 10

Slide 10 text

Raid Detection  This checks if more than n users have joined in m seconds, and still uses this system today.  If this happens, alerts the moderators and puts the server in lockdown  The mods can then activate autosilence mode to “cage” all newcomers for interrogation  Lockdown increase security level to the maximum to temporarily halt spammers  This is necessary to deal with enormous bot raids due to rate limit problems  Now also supports banning everyone in a raid instantly.

Slide 11

Slide 11 text

Other Useless Features

Slide 12

Slide 12 text

Meanwhile