Skip to content

Instantly share code, notes, and snippets.

@newmania
newmania / bot.py
Last active March 31, 2020 15:49
simple bot that runs perspective API checks on Discord messages and adds reacts if they score high
import discord, json, requests
from ratelimit import limits
#set up Discord client
client = discord.Client()
#rate limit decorator because Perspective API limits you to 1 query per second
@limits(calls=1, period=1)
def toxic_check(message):

Keybase proof

I hereby claim:

  • I am newmania on github.
  • I am mikenewman (https://keybase.io/mikenewman) on keybase.
  • I have a public key ASAdneLvBEgPNy0tvHbfeVMbfGl-KBGdt_Be814Fd-YdEAo

To claim this, I am signing this object: