Answer the question
In order to leave comments, you need to log in
How to send a random question from the ones already prepared for the telegram bot on Aiogram?
I am making a bot for Telegram in Python. I don't know how to do the following:
After clicking on the "Question" button in the bot, randomly send a question from the previously prepared questions.
Answer the question
In order to leave comments, you need to log in
# в методе обрабатывающем кнопку
import random
question = random.choice(QUESTIONS) # из списка (list) вопросов (текста) выдаёт один случайный вариант .
метод_отображения_кнопки (question) # Вывод случайного вопроса .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question