import telebot
import config
from telebot import types
bot = telebot.TeleBot('1691795389:AAFdvsX-vGxErbzWyl8pfxVB58ai5D5-Gw0')
@bot.message_handler(commands=['start'])
def welcome(message):
# Keyboard
button_hi = types.InlineKeyboardButton(text="Готово✅", callback_data='r')
start_kb = types.InlineKeyboardMarkup(row_width=2)
start_kb.add(button_hi)
bot.send_message(message.chat.id, "<b>Привет, {0.first_name}!</b>\n<b>Подпишись на канал - https://t.me/joinchat/MZLkSEnGoKIzMTUy</b>".format(message.from_user, bot.get_me()), parse_mode='html', reply_markup=start_kb, disable_web_page_preview=True)
@bot.message_handler(content_types=['text'])
def lalala(message):
if message.chat.type == 'private':
button_next = types.InlineKeyboardButton("Готово✅", callback_data='r')
next_kb = types.InlineKeyboardMarkup(row_width=2)
next_kb.add(button_next)
bot.send_message(message.chat.id, '', reply_markup=button_next)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
try:
if call.message:
if call.data == 'r':
status = ['creator', 'administrator', 'member']
for chri in status:
if chri == bot.get_chat_member(chat_id="@footballdaily24", user_id=call.from_user.id).status:
bot.send_message(message.chat.id, "Спасибо за подписку!")
break
else:
bot.send_message(message.chat.id, "Кажется вы не подписались!")
else:
bot.send_message(message.chat.id, "Я не знаю что ответить")
except Exception as e:
print(repr(e))
# RUN
bot.polling(none_stop=True)