#Duplicate messages when I load cogs
1 messages · Page 1 of 1 (latest)
def start_cogs():
for filename in os.listdir('./cogs'):
try:
bot.load_extension(f'cogs.{filename[:-3]}')
print(f'Loaded {filename[:-3]}')
except:
print(f'Unable to load {filename[:-3]}')
return
start_cogs()```
What's the context menu response
@bot.message_command(name="Add Quote") # Creates a global message command
async def add_quote(ctx, message: discord.Message): # Message commands give a message param
x = collection.find_one({'GuildID' : ctx.guild.id}, {"Server Quotes":1, "Settings":1, "Premium":1, "_id": False})
if message.embeds != []:
await ctx.respond("You can't quote an embed!", ephemeral=True)
else:
if x['Settings']['ApprovalChannel'] == None:
await ctx.respond("Please have an admin set a approval channel with ``/set approvalchannel``", ephemeral=True)
return```
So the last part keeps duplicating and sending twice not sure why. No I am not running two processes I have checked multiple times. Not sure what the issue is and I am very confused
Sent in #General Help
·
The context menu is in the main file
When cogs are commented out it doesn’t send duplicate response. But when it isn’t it sends two response
I'd need full code of like everything lol
When I get a chance tomorrow I will
Okay found the issue sorry for the delay
await bot.process_application_commands(interaction) ```
Seems that on_interaction already handles that so it was handling interactions twice