0
import telebot

bot = telebot.TeleBot(token="")

@bot.massage_handler(comands=["start"])

def first (massage):
key = telebot.types.ReplayKeyboardMarkup (True,False)
key.row("Кнопка 1", "Кнопка 2")

При запуске пишет:

"E:\python\bot.py", line 5, in <module>
    @bot.massage_handler(comands=["start"])
AttributeError: 'TeleBot' object has no attribute 'massage_handler'
1
  • Могли бы и отметить ответ как решение, раз уж использовали его в другом вопросе.
    – V-Mor
    26 июл 2019 в 12:30

1 ответ 1

0

Если планируется обработчик сообщений, а не массажа, я бы всё-таки советовал message_handler:

import telebot

bot = telebot.TeleBot(token="")
@bot.message_handler(comands=["start"])

def first (message):
key = telebot.types.ReplayKeyboardMarkup (True,False)
key.row("Кнопка 1", "Кнопка 2")

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.