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):
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()
async def on_ready(self):
"""Display startup message"""

@ -20,5 +20,18 @@ from bot import Bot
# Initiating Bot Object As Client
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
client.execute()

Loading…
Cancel
Save