Stopped messages from displaying twice

pull/9/head
sgoudham 4 years ago
parent 034eab64dc
commit 5604746e4f

@ -11,17 +11,6 @@ class Events(Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@Cog.listener()
async def on_message(self, message):
"""Make sure bot messages are not tracked"""
# Ignoring messages that start with 2 ..
if message.content.startswith("..") or message.author.bot:
return
# Processing the message
await self.bot.process_commands(message)
@Cog.listener() @Cog.listener()
async def on_ready(self): async def on_ready(self):
"""Display startup message""" """Display startup message"""

@ -20,5 +20,18 @@ from bot import Bot
# Initiating Bot Object As Client # Initiating Bot Object As Client
client = Bot() client = Bot()
@client.event
async def on_message(message):
"""Make sure bot messages are not tracked"""
# Ignoring messages that start with 2 ..
if message.content.startswith("..") or message.author.bot:
return
# Processing the message
await client.process_commands(message)
# Run the bot # Run the bot
client.execute() client.execute()

Loading…
Cancel
Save