6
votes

I have a Discord bot and a webhook setup for a Discord channel to send a command every hour on the dot. However it seems that Discord Rewrite by default ignores commands sent from other bots. How do I go about disabling this?

Do I need to modify something on a per-command function or the on_message function?

Current on message

@bot.event
async def on_message(message):
    await bot.process_commands(message)

Edit: Found the solution

@bot.event
async def on_message(message):
    ctx = await bot.get_context(message)
    await bot.invoke(ctx)
1
Rather than editing you original question I would recommend posting your solution as a answer. This is a common accepted way to do this on stackoverflow. :) - Tim
I don't recommend responding to other bots, if you did, you can't apply your bot in top.gg. - sairam kumar
By default, your bot will respond to other bots's messages. I'm not sure about commands, but it does responds to messages Edit: What is it that you exactly want? Other bots to respond to your bot? or your bot to respond to other bots? - StatTrakDiamondSword

1 Answers

1
votes

try adding a check for it, example :

on_message

if message.author.bot == True:
    #Do something

command

if ctx.author.bot == True:
    #Do something