Added bad words as a text file so you don't need to push new code to edit the list. Also made it so the CC can not change presence to a curse word

This commit is contained in:
Sean Wang
2019-03-26 12:21:58 -04:00
parent 205dc40e3a
commit c3a0701a12
2 changed files with 13 additions and 32 deletions

1
bad_words.txt Normal file
View File

@@ -0,0 +1 @@
{"fuck": "frick", "f\u00fcck": "frick", "fucker": "falcon", "fucking": "falconing", "dick": "duck", "bitching": "blipping", "lmao": "lmbo", "motherfucker": "motherfricker", "shit": "poop", "bitch": "blip", "hell": "heck", "ass": "butt", "asshole": "butthole", "bastard": "custard", "damn": "dang", "dammit": "dangit", "damnit": "dangit", "cunt": "punt", "biatch": "bleach", "smd": "smp", "bitches": "beaches", "tit": "bit", "tits": "bits", "lmfao": "lmfba", "whore": "princess", "slut": "butt", "shitter": "digger"}

View File

@@ -3,6 +3,7 @@ from discord import Game
import random
from pathlib import Path
import re
import json
BOT_PREFIX = "+"
@@ -94,13 +95,20 @@ async def praise_user(context, *arg):
pass_context=True)
async def change_presence(context, *arg):
target = ''
bad_words = json.load(open("bad_words.txt"))
if arg.__len__() == 0:
target = 'sinners'
else:
for current_word in arg:
target = target + ' ' + current_word
await client.say("Seems that " + context.message.author.mention + " wants to cleanse the " + target + ". So be it!")
await client.change_presence(game=Game(name="with " + target))
if current_word in bad_words.keys():
await client.say(
"Do you take me for a fool, " + context.message.author.mention + "?")
return
else:
target = target + ' ' + current_word
await client.say("Seems that " + context.message.author.mention + " wants to cleanse the " + target +
". So be it!")
await client.change_presence(game=Game(name="with " + target))
@client.event
@@ -111,35 +119,7 @@ async def on_ready():
@client.event
async def on_message(message):
bad_words = {
'fuck': 'frick',
'fück': 'frick',
'fucker': 'falcon',
'fucking': 'falconing',
'dick': 'duck',
'bitching': 'blipping',
'lmao': 'lmbo',
'motherfucker': 'motherfricker',
'shit': 'poop',
'bitch': 'blip',
'hell': 'heck',
'ass': 'butt',
'asshole': 'butthole',
'bastard': 'custard',
'damn': 'dang',
'dammit': 'dangit',
'damnit': 'dangit',
'cunt': 'punt',
'biatch': 'bleach',
'smd': 'smp',
'bitches': 'beaches',
'tit': 'bit',
'tits': 'bits',
'lmfao': 'lmfba',
'whore': 'princess',
'slut': 'butt',
'shitter': 'digger'
}
bad_words = json.load(open("bad_words.txt"))
possible_retorts = [
', you vile creature....',
', you forget your place!',