Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sweetie Bot by Cloud Hop (#PonyDev @ BronyCon 2017)

Sweetie Bot by Cloud Hop (#PonyDev @ BronyCon 2017)

A 5 minute lightning talk at BronyCon 2017's Pony Developers and Coders panel. Find more at http://developer.horse

Inky Collective

August 12, 2017
Tweet

More Decks by Inky Collective

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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?!
  5. 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.
  6. 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.