@ghazar7an

Process finished with exit code 0 || Как решить?

Process finished with exit code 0
Что тут не так ?
import config
import telebot
import requests
from bs4 import BeautifulSoup as BS
r = requests.get('https://sinoptik.ua/погода-ереван')
html = BS(r.content, 'html.parser')
bot = telebot.TeleBot(config.token)

for el in html.select('#content'):
    t_min = el.select('.temperature .min')[0].text
    t_max = el.select('.temperature .max')[0].text
    text = el.select('.wDescription .description')[0].text

    keyboard1 = telebot.types.ReplyKeyboardMarkup()
    keyboard1.row('Погода', 'Եղանակ', 'Help', 'Новости')
@bot.message_handler(commands=['start'])
def start_message(message):
    privetstvie = f" Привет {message.from_user.first_name} \nНиже представлены команды бота: "
    bot.send_message(message.chat.id, privetstvie, resize_keyboard=True,  reply_markup=keyboard1)


@bot.message_handler(commands=['Text' , 'Putin' , 'Путин'])
def send_message(message):
    bot.send_sticker(message.chat.id, 'CAADAgADZgkAAnlc4gmfCor5YbYYRAI')

@bot.message_handler(content_types=['text'])
def send_text(message):
        if message.text == 'Погода':
            bot.send_message(message.chat.id, "Привет, погода на сегодня в Ереване:\n" +
                     t_min + ', ' + t_max + '\n' + text)
        elif message.text == 'Եղանակ':
            bot.send_message(message.chat.id, "Привет, погода на сегодня в Ереване:\n" +
                     t_min + ', ' + t_max + '\n' + text)


@bot.message_handler(content_types=['text'])
def send_text(message):
        if message.text == 'Помощь':
            bot.send_message(message.chat.id, "Список команд: \n <b>/start<b/>")
        elif message.text == 'Help':
            bot.send_message(message.chat.id, "Список команд: \n <b>/start<b/>")


if __name__ == '__main__':
    bot.polling(none_stop=True)
  • Вопрос задан
  • 943 просмотра
Решения вопроса 1
hottabxp
@hottabxp Куратор тега Python
Сначала мы жили бедно, а потом нас обокрали..
У вас в коде ошибка:
из строки:
bot.send_message(message.chat.id, privetstvie, resize_keyboard=True,  reply_markup=keyboard1)

нужно 'resize_keyboard=True' удалить,
а добавить в:
keyboard1 = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True)
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы