Guest User

Untitled

a guest
Oct 3rd, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. import telebot
  2. from telebot import types
  3. from telebot import apihelper
  4. import confbot
  5. import pymysql
  6.  
  7.  
  8. bot = telebot.TeleBot(confbot.TOKEN)
  9.  
  10.  
  11.  
  12. @bot.message_handler(commands=['start'])
  13. def start_message(message):  
  14.     markup = telebot.types.InlineKeyboardMarkup()
  15.     markup.add(telebot.types.InlineKeyboardButton(text='+74955555555', callback_data=3))
  16.     bot.send_message(message.chat.id, text='1111111', parse_mode='HTML', reply_markup=markup)
  17.  
  18.  
  19. @bot.message_handler(content_types=['text'])
  20. def send_text(message):
  21.     if message.text.lower() == 'привет':
  22.         bot.send_message(message.chat.id, 'neprivet.ru')
  23.     elif message.text.lower() == 'пока':
  24.         bot.send_message(message.chat.id, 'Удачи в начинаниях')
  25.  
  26. @bot.callback_query_handler(func=lambda call: True)
  27. def query_handler(call):
  28.  
  29.     bot.answer_callback_query(callback_query_id=call.id, text='Первый!!')
  30.     answer = ''
  31.     if call.data == '3':
  32.         answer = 'Вы позвонили!'    
  33.  
  34.     bot.send_message(call.message.chat.id, answer)
  35.     bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id)
  36.  
  37. bot.polling()
Advertisement
Add Comment
Please, Sign In to add comment