How do I stop an infinite while loop
How do I break out of a while loop?
I have a discord bot that can spam messages. I passed it through a while loop using the following:
while user_message.lower() == '!activate': await message.channel.send('@MrFreshlyBakedPi3 HAPPY BIRTHDAY!!’)
Of course, I don’t want this to spam happy birthday to my friend forever, so I need a !deactivate command. I have tried several different lines of code to get this to work, (using both return/break, as well as if/elif), but I havent been successful. Could someone properly write a line of code to break the loop for me? I'm using Python 3.9 btw.