Adding new classes to upgrade the music code organization

This commit is contained in:
Rafael Vargas
2021-12-24 19:05:03 -04:00
parent 29998997bc
commit 4ba03ff8bc
17 changed files with 140 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
from discord.ext import commands
class Filter(commands.Cog):
"""Deal with filtering of discord messages"""
def __init__(self, bot):
self.__bot = bot
@property
def bot(self):
return self.__bot
@bot.setter
def bot(self, newBot):
self.__bot = newBot
@commands.Cog.listener()
async def on_message(self, message):
if message.author == self.__bot.user:
return
if 'elx' in message.content:
await message.channel.send(f'Coé {message.author.name}, tu é gay memo hein bicho')
def setup(bot):
bot.add_cog(Filter(bot))