Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import telebot
- from telebot import types
- from telebot import apihelper
- import confbot
- import pymysql
- bot = telebot.TeleBot(confbot.TOKEN)
- @bot.message_handler(commands=['start'])
- def start_message(message):
- markup = telebot.types.InlineKeyboardMarkup()
- markup.add(telebot.types.InlineKeyboardButton(text='+74955555555', callback_data=3))
- bot.send_message(message.chat.id, text='1111111', parse_mode='HTML', reply_markup=markup)
- @bot.message_handler(content_types=['text'])
- def send_text(message):
- if message.text.lower() == 'привет':
- bot.send_message(message.chat.id, 'neprivet.ru')
- elif message.text.lower() == 'пока':
- bot.send_message(message.chat.id, 'Удачи в начинаниях')
- @bot.callback_query_handler(func=lambda call: True)
- def query_handler(call):
- bot.answer_callback_query(callback_query_id=call.id, text='Первый!!')
- answer = ''
- if call.data == '3':
- answer = 'Вы позвонили!'
- bot.send_message(call.message.chat.id, answer)
- bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id)
- bot.polling()
Advertisement
Add Comment
Please, Sign In to add comment