'stopping while true loop in discord.py with command
Im making a simple crash gamble command in discord bot, but i don't know, when i use !crash money, how to stop it with !stop. I have a while True loop and i want to make somehow break the while true loop with the command !stop, i have no idea, how to make the command.
simplified code
@client.command()
async def crash(ctx, amount = None):
multiplier = 1
while True:
multiplier += 0.2
#here i would like something, when author of the crash command will write !stop, it will break the while true loop
win_amount = int(multiplier*amount)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
