K
K
Klew3R2022-01-04 16:24:32
Python
Klew3R, 2022-01-04 16:24:32

How to solve the problem for Telegram Bot CODE:400 (__init__.py:690 MainThread?

import telebot
import config

from telebot import types

client=telebot.TeleBot('///')
@client.message_handler(commands=['start'])

def welcome(message):
markup_inline = types.InlineKeyboardMarkup()

#Keyboard
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item_yes = types.InlineKeyboardButton(text = 'Yes, I want', callback_data = 'yes')
item_no = types.InlineKeyboardButton('No, I don't want')

markup_inline.add(item_yes, item_no)

client .send_message(message.chat.id, 'Hello I want a bot to pass the test?',
reply_markup = markup_inline)

@client.callback_query_handler(func = lambda call: True)
def answer(call):
if call.data == 'yes':
client.send_message(message.chat.id, 'Food Image')
markup_reply = types.ReplyKeyboardMarkup(resize_keyboard = True)
item_1 = types.KeyboardButton('Evil')
item_11 = types. KeyboardButton('Right')

markup_reply.add(item_1, item_11)
client.send_message(call.message.chat.id, 'Select the correct answer',
reply_markup = markup_reply)

elif call.data == 'no':
client.send_message( message.chat.id, 'You're wondering why you don't want to take this test? More than 70% of people don't know what phishing is!')

@client.message_handler(content_types = ['text'])
def get_text(message) :
if message.text == 'Evil':
client.send_message(message.chat.id, 'Properly Down')
elif message.text == 'Right':
client.send_message(message.chat.id, 'THE Down Down')

client.polling(none_stop=True)

HERE the code itself does not work

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question