#Duplicate messages when I load cogs

1 messages · Page 1 of 1 (latest)

cyan gate
#

So when I don't load any cogs the bot will only respond once to the context menu response. But when I load the single cog it will respond multiple times.

#
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()```
misty coyote
forest craneBOT
# cyan gate https://discord.com/channels/881207955029110855/998272089343668364/1044039532703...
Message Author: Tinyy#3205
@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
misty coyote
#

Is that command in a cog too?

#

Cause the code looks like its in the main file

cyan gate
#

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

misty coyote
#

I'd need full code of like everything lol

cyan gate
#

When I get a chance tomorrow I will

cyan gate
#

Okay found the issue sorry for the delay

cyan gate