Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow Discord Rewrite bot to respond to other bots

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)
like image 594
Cynthia Valdez Avatar asked Mar 23 '19 21:03

Cynthia Valdez


People also ask

Can a Discord bot trigger another bot?

When running a big discord server, not one bot can do all asks.

How do you make a Discord bot respond to a random message?

on Jun 1, 2020. No problem! You can place the let replies = ["reply 1", "reply 2", "reply 3"]; at the top of your file (e.g. where you require discord.io ) and you can put the entire bot. sendMessage function whenever and wherever you need to send one of those random replies!

Can a bot add another bot?

Yes, the action of one bot can trigger another: for example, one bot can modify a row and then trigger another bot. NOTE: bots will cut short and show an error if there are too many recursive bot executions or cyclical execution loops, to avoid overloading the system.

How do you make it so only certain roles can use bots?

At the moment, the only way to restrict bots to one channel only is to manually remove the bot's chat permissions in each channel that you don't want it in. The more channels you have in a server, the more tedious it becomes.


1 Answers

Try adding a check for it:

on_message:

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

command:

if ctx.author.bot == True:
    #Do something
like image 170
Raphiel Avatar answered Oct 13 '22 08:10

Raphiel