0
votes

Im trying to make a program to create an endless loop, for example:

bot1.py

@bot.command()
async def loop1(ctx):
    await ctx.send('$loop2')

bot2.py

@bot.command()
async def loop2(ctx):
    await ctx.send('$loop1')

But the main problem is a bot would not listen to another bot, so this won't work...

is there a way to make a bot listen to another bot? Thanks in advance! :)

1
Explain your user case and how would this be used and why.BrainDead
I thought it would be interesting if that works? just for me to use i guess.3Npow3r3d

1 Answers

1
votes

Maybe instead of using the async def to define a command, you could use the on_message event.

bot1.py:

@bot.event
async def on_message(message):
 if message.content.startswith('$loop1'):
     channel = message.channel
     await channel.send("$loop2")

bot2.py:

@bot.event
async def on_message(message):
 if message.content.startswith('$loop2'):
     channel = message.channel
     await channel.send("$loop1")

not entirely sure if this will work, but you could try