import telebot
import config
from telebot import types
bot = telebot.TeleBot(config.TOKEN)
language = "kazakh"
keyboard1 = types.ReplyKeyboardMarkup()
item_kaz = types.ReplyKeyboardMarkup(text = "Қазақ тілі", callback_data = "kazakh")
item_rus = types.ReplyKeyboardMarkup(text = "Русский язык", callback_data = "russian")
keyboard1.add(item_kaz, item_rus)
keyboard2 = types.ReplyKeyboardMarkup(True, True)
item_7 = types.ReplyKeyboardMarkup(text = "7", callback_data = "7")
item_8 = types.ReplyKeyboardMarkup(text = "8", callback_data = "8")
item_9 = types.ReplyKeyboardMarkup(text = "9", callback_data = "9")
item_10 = types.ReplyKeyboardMarkup(text = "10", callback_data = "10")
item_11 = types.ReplyKeyboardMarkup(text = "11", callback_data = "11")
item_12 = types.ReplyKeyboardMarkup(text = "12", callback_data = "12")
keyboard2.add(item_7, item_8, item_9, item_10, item_11, item_12)
keyboard3 = telebot.types.ReplyKeyboardMarkup(True, True)
item_1 = types.ReplyKeyboardMarkup(text = "1", callback_data = "1")
item_2 = types.ReplyKeyboardMarkup(text = "2", callback_data = "2")
item_3 = types.ReplyKeyboardMarkup(text = "3", callback_data = "3")
item_4 = types.ReplyKeyboardMarkup(text = "4", callback_data = "4")
keyboard3.add(item_1, item_2, item_3, item_4)
@bot.message_handler(commands=['start'])
def welcome(message):
sti = open('static/welcome.webp', 'rb')
bot.send_sticker(message.chat.id, sti)
bot.send_message(message.chat.id, " Қош келдіңіз / Добро пожаловать, {0.first_name}!\nМенің атым / Я - <b>{1.first_name}</b>.Тілді таңдаңыз / Выберите язык.".format(message.from_user, bot.get_me()), parse_mode='html', reply_markup=keyboard1)
def synyptar(message):
bot.send_message(message.chat.id, 'Сыныпты таңдаңыз / Выберите класс', reply_markup=keyboard2)
def toqsandar(message):
bot.send_message(message.chat.id, 'Тоқсанды таңдаңыз / Выберите четверть', reply_markup=keyboard3)
@bot.message_handler(content_types=['text'])
def lalala(message):
bot.send_message(message.chat.id, message.text)
#RUN
bot.polling(none_stop=True)
こんにちは皆さん、最近、電報に関連する不快な問題に直面しました。ReplyKeyboardMarkup でボタンを追加したいのですが、Python ではチャンスがありません。ご理解いただけましたら、この問題の解決にご協力ください。
item_kaz = types.InlineKeyboardMarkup(text = "Қазақ тілі", callback_data = "kazakh")
TypeError: __init__() got an unexpected keyword argument 'text'