Пример #1
0
from config import TOKEN
import telebot
import random
from SQLighter import SQLighter
from telebot import types
import utils
import os
import time
name = ''
surname = ''
age = 0
db = SQLighter("test_bot.db")

db.create_table()

bot = telebot.TeleBot(token=TOKEN)


@bot.message_handler(commands="unsubscribe")
def get_unsubs(message: types.Message):

    markup = types.InlineKeyboardMarkup()
    key_yes = types.InlineKeyboardButton(text="Да",
                                         callback_data="yes_unsubscribe")
    markup.add(key_yes)
    key_no = types.InlineKeyboardButton(text="нет",
                                        callback_data="no_unsubscribe")
    markup.add(key_no)
    bot.send_message(message.chat.id,
                     "Правда,хотите отписаться?",
                     reply_markup=markup)