temporarily change nicknames of 'banned' users

This commit is contained in:
xenofem 2020-05-15 22:37:12 -04:00
parent c4cd3af702
commit 4b351648f7

View file

@ -1,3 +1,4 @@
import asyncio
import discord import discord
import sys import sys
@ -28,7 +29,7 @@ RUDE_WORDS = [
'titties', 'titties',
'vagina' 'vagina'
] ]
@client.event @client.event
async def on_ready(): async def on_ready():
print('logged in as {0.user}'.format(client), file=sys.stderr) print('logged in as {0.user}'.format(client), file=sys.stderr)
@ -40,6 +41,10 @@ async def on_message(message):
if any(w in message.content for w in RUDE_WORDS): if any(w in message.content for w in RUDE_WORDS):
await message.channel.send('Your Club Penguin account has been deactivated for inappropriate language.') await message.channel.send('Your Club Penguin account has been deactivated for inappropriate language.')
oldnick = message.author.nick
await message.author.edit(nick="BANNED")
await asyncio.sleep(300)
await message.author.edit(nick=oldnick)
with open('token') as f: with open('token') as f:
token = f.read().strip() token = f.read().strip()