So I have this piece of code which is running on a discord bot which should repeat what the user says after a command. It does this but repeats it another 7 times after making 8 total runs through that script. Can anyone spot why this might be happening?
Note: The code that actually runs starts from the elif but I put in everything just in case something prior was messing with it.
@Client.event
async def on_message(message):
if message.content == "s!ping":
userID = message.author.id
Client.send_message(message.channel, "<@%s>" % (userID))
elif message.content.startswith == "s!say":
args = message.content.split(" ")
Client.send_message(message.channel, "%s" % (args[1:]))
Image to show test input and output
I'm the CEO of Repl.it. I think this might be a bug with scaling on our service where we might run multiple instances of your server. We'll have a fix for this soon. Meanwhile, I think some other Repl.it users had a fixe for this. Join us on our Discord, there are lots of bot developers there that can help you with this https://discord.gg/xa6S23
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With