1

I'm trying to make a game bot on telegram, but I'm confused in callback query. I have made a command named /start. When a user sends that command, the bot sends two inline keyboard a and b. If a gets pressed, the bot runs a code c = 10 - 2. If b gets pressed, the bot runs a code c = 10 - 4. I want to run this loop until the valua of c becomes Zero. i mean i want the bot to send this two inline button again and again until the value of c gets zero. Any suggestions? I tried but it turned into a infinite loop.

c = 10
while c != 0:
    if query.data == a:
        c = 10 - 2
    elif query.data == b:
        c = 10 - 4

0 Answers0