Closed Garry-Marshall closed 1 year ago
I tried adding
and message.author != client.user:
but that doesn't change anything.
From time to time, it gets stuck in a loop and repeats itself over and over again. Setting the self.chance_to_reply_to_other_bots to 0 seems to mitigate it. At least couldn't reproduce it again after that change. edit: issue still persists. Bot keeps repeating itself. Asking 'What is your name' triggers it pretty consistently.
Ah, I havent noticed this, thanks for pointing it out. Guess I have to stir the spaghetti some more.. Pretty sure there already is a "do not reply to yourself" logic in the behavior that should make it abort immediately, but it's probably overridden by some other spaghetti at this point. Maybe the bit that lets it reply to other users who are also bots.
Maybe the bit that lets it reply to other users who are also bots.
Yeah, that's the part controlled with the probability? I set it to 0 to exclude that, but that didn't change a thing.
Well, I noticed that if I set the bot's nickname to something else than its used name, the loop doesn't occur when it writes it's own name. (it triggers only once, and produces two lines of output instead of an infinite loop)
User: What is your name BOT My name is Bot BOT My name is Bot BOT My name is Bot ...
After changing the nickname:
User: What is your name Nickname My name is Bot Nickname You know who I am
Haven't had it stuck in a loop again after that. Not sure how relevant it is, but maybe this can pinpoint you to the root of the issue.
This is a weird one, and doesnt happen on my build right now. I hastily pushed some other fix after they updated oobabooga though, so I may have missed something then. I did notice some similar weird repeating errors then too.
I've updated it now, with a bit of a brute force to stop it from replying to itself at least, hoping it'll work out. Gonna let it run for a while and see if it repeats itself.
That seems to have fixed it.
Probably in this part of the code: