Skip to content

Instantly share code, notes, and snippets.

@GrunclePug
Created June 27, 2018 22:12
Show Gist options
  • Save GrunclePug/b828cd33257b83958bdefccfc30f27f9 to your computer and use it in GitHub Desktop.
Save GrunclePug/b828cd33257b83958bdefccfc30f27f9 to your computer and use it in GitHub Desktop.
Word Filteration Discord Python
#Discord Bot by GrunclePug#7015
#Libraries
import discord
from discord.ext import commands
import asyncio
import platform
#Bot setup
version = "Gruncle Word Filteration v0.1"
desc = '''GrunclePug | Word Filteration'''
client = commands.Bot(command_prefix='~~', description=desc)
chat_filter = ["NIGGER", "NLGGER", "FUCK", "FUCKING", "SHIT", "ASSHOLE", "BITCH", "CUNT", "SHITASS", "MOTHERFUCKER", "PRICK"]
#Startup
@client.event
async def on_ready():
print('Logged in as '+client.user.name+' (ID:'+client.user.id+') | Connected to '+str(len(client.servers))+' servers | Connected to '+str(len(set(client.get_all_members())))+' users')
print('~~~~~~~~')
print('Current Discord.py Version: {} | Current Python Version: {}'.format(discord.__version__, platform.python_version()))
print('~~~~~~~~')
print('Use this link to invite {}:'.format(client.user.name))
print('https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=0'.format(client.user.id))
print('~~~~~~~~')
print(version)
print('Created by GrunclePug#7015')
return await client.change_presence(game=discord.Game(name='GrunclePug | Word Filteration'))
#Word Filteration
@client.event
async def on_message(message):
contents = message.content.split(" ")
for word in contents:
if word.upper() in chat_filter:
await client.delete_message(message)
await client.send_message(message.channel, "Watch out! That word is banned!!")
#Bot token
client.run('NDYxNjUxMzE2Nzc1ODQ1ODg4.DhWZzw.62ZhD3Nr1boMi7uZcXio4Tgy9jw')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment