menu.add(types.InlineKeyboardButton(text=f'{i[0]}', callback_data=f'{i[1]}'), types.InlineKeyboardButton(text=f'{i[0]}', callback_data=f'{i[1]}'))
menu.add(types.InlineKeyboardButton(text=i[0], callback_data=i[1]))
import telebot
print('******1')
from config import token
print('****2')
from telebot import types
bot = telebot.TeleBot(token)
@bot.message_handler(commands = ['start'])
def welcome(message):
bot.send_message(message.chat.id, 'Привет, {0.first_name}!\nЧтобы поискать статьи в техноблоге по моделям нажмите /tech'.format(message.from_user, bot.get_me()), parse_mode='html')
@bot.message_handler(commands = ['tech'])
def tech(gg):
kb = types.InlineKeyboardMarkup()
brand1 = types.InlineKeyboardButton(text='Kingsong', callback_data = 'kingsong')
brand2 = types.InlineKeyboardButton(text='Inmotion', callback_data = 'inmotion')
kb.add(brand1, brand2)
bot.send_message(gg.chat.id, "Choose a brand", reply_markup=kb)
@bot.callback_query_handler(func=lambda call: True)
def tech_ob(call):
if call.data == 'kingsong':
bot.send_message('KS')
elif call.data == 'inmotion':
bot.send_message('Im')
bot.polling(none_stop=True)