Skip to content

Poll Quiz #2118

@prasaanth2k

Description

@prasaanth2k

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? - 4.14.1

  2. What OS are you using? - Ubuntu

  3. What version of python are you using? - Above Python3

import telebot
import schedule
import time

# Replace 'YOUR_BOT_TOKEN' with your actual Telegram Bot token
bot_token = 'token'
chat_id = 'Chat_id'

bot = telebot.TeleBot(bot_token)

def send_scheduled_message():
    message_text = "This is a scheduled message!"
    bot.send_poll(
    chat_id,
    question="Which of the following command is used to add a new user to the system?",
    options=['Linux', 'adduser', 'useradd', 'All of above'],
    is_anonymous=False,correct_option_id=2,)

# Schedule the message to be sent every day at a specific time (adjust the time as needed)
schedule.every(3).seconds.do(send_scheduled_message)

# Run the scheduler in the background
while True:
    schedule.run_pending()
    time.sleep(1)

When ever the bot send the quiz the correct option is not working it accpection all answers showing correct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions