import telebot
from telebot import types
from choosing_tariff import tariffs
class FreedomBot:
def __init__(self, token):
self.token = token
self.bot = telebot.TeleBot(self.token)
self.register_handlers()
def register_handlers(self):
@
self.bot .message_handler(commands=["start"])
def start(message):
markup = types.InlineKeyboardMarkup(row_width=2)
item0 = types.InlineKeyboardButton('Тарифы', callback_data='tariffs')
item1 = types.InlineKeyboardButton('Офисы', callback_data='question_2')
item2 = types.InlineKeyboardButton('Подключить', callback_data='question_3')
item3 = types.InlineKeyboardButton('Помощь', callback_data='question_4')
markup.add(item0, item1, item2, item3)
self.bot .send_message(message.chat.id, text="__________Меню__________", reply_markup=markup)
@
self.bot .callback_query_handler(func=lambda call: True)
def callback(call):
if call.data == 'tariffs':
tariffs(
self.bot , call.message)
def start_bot(self):
self.bot .polling()
# Инициализация и запуск бота
if __name__ == "__main__":
token = "YOUR_BOT_TOKEN_HERE"
bot = FreedomBot(token)
bot.start_bot()