Хочу сделать TgBot, который сможет выдавать с сайта EpicGames игры которые раздаются бесплатно. Но при запросе, выдает ошибку 400
2022-12-07 18:10:22,455 (__init__.py:1087 MainThread) ERROR - TeleBot: "Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: message text is empty"
2022-12-07 18:10:22,457 (__init__.py:1089 MainThread) ERROR - TeleBot: "Exception traceback:
Traceback (most recent call last):
Вот сам код
url = "https://store.epicgames.com/ru/free-games"
r = requests.get(url)
def parser(url):
r = requests.get(url)
soup = b(r.text, "html.parser")
game = soup.find_all("div", class_="css-hkjq8i")
return [c.text for c in game]
list_game = parser(url)
random.shuffle(list_game)
@bot.message_handler(commands=["epic"])
def jokes(message):
markup = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True, row_width=2)
Yes = types.KeyboardButton('3')
No = types.KeyboardButton('4')
markup.add(Yes,No)
if message.text.lower() == "3":
bot.send_message(message.chat.id, list_game)
del list_game
elif message.text.lower() == "4":
bot.send_message(message.chat.id,"Говнюк",reply_markup=types.ReplyKeyboardRemove())