import telebot
from telebot import types
bot = telebot.TeleBot("")
@bot.message_handler(commands=['start'])
def welcome(message):
# keyboard
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton(" Семья шпиона")
item2 = types.KeyboardButton(" Летнее время")
markup.add(item1, item2)
bot.send_message(message.chat.id,"Добро пожаловать любитель аниме, {0.first_name}!\nЯ - <b>{1.first_name}</b>,что желаешь посмотреть? .".format( message.from_user, bot.get_me()),parse_mode='html', reply_markup=markup)
@bot.message_handler(content_types=['text'])
def lalala(message):
if message.chat.type == 'private':
markup = types.InlineKeyboardMarkup(row_width=2)
item1 = types.InlineKeyboardButton("1 серия", callback_data='1')
item2 = types.InlineKeyboardButton("2 серия", callback_data='2')
item3 = types.InlineKeyboardButton("3 серия", callback_data='3')
item4 = types.InlineKeyboardButton("4 серия", callback_data='4')
item5 = types.InlineKeyboardButton("5 серия", callback_data='5')
item6 = types.InlineKeyboardButton("6 серия", callback_data='6')
item7 = types.InlineKeyboardButton("7 серия", callback_data='7')
item8 = types.InlineKeyboardButton("8 серия", callback_data='8')
item9 = types.InlineKeyboardButton("9 серия", callback_data='9')
markup.add(item1, item2, item3, item4, item5, item6, item7, item8, item9)
bot.send_message(message.chat.id, 'Какая серия?', reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
try:
if call.message:
if call.data == '1':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-1.html ')
if call.data == '2':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-2.html')
if call.data == '3':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-3.html')
if call.data == '4':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-4.html')
if call.data == '5':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-5.html')
if call.data == '6':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-6.html')
if call.data == '7':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-7.html')
if call.data == '8':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-8.html')
if call.data == '9':
bot.send_message(call.message.chat.id, 'https://jut.su/spy-family/episode-9.html')
except Exception as e:
print(repr(e))
def lala(message):
if message.chat.type == 'private':
markup = types.InlineKeyboardMarkup(row_width=2)
item1 = types.InlineKeyboardButton("1 серия", callback_data='1a')
item2 = types.InlineKeyboardButton("2 серия", callback_data='2a')
item3 = types.InlineKeyboardButton("3 серия", callback_data='3a')
item4 = types.InlineKeyboardButton("4 серия", callback_data='4a')
item5 = types.InlineKeyboardButton("5 серия", callback_data='5a')
item6 = types.InlineKeyboardButton("6 серия", callback_data='6a')
item7 = types.InlineKeyboardButton("7 серия", callback_data='7a')
item8 = types.InlineKeyboardButton("8 серия", callback_data='8a')
markup.add(item1, item2, item3, item4, item5, item6, item7, item8)
bot.send_message(message.chat.id, 'Какая серия?', reply_markup=markup)
def callback_inlinee(call):
try:
if call.message:
if call.data == '1a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-1.html')
if call.data == '2a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-2.html')
if call.data == '3a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-3.html')
if call.data == '4a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-4.html')
if call.data == '5a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-5.html')
if call.data == '6a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-6.html')
if call.data == '7a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-7.html')
if call.data == '8a':
bot.send_message(call.message.chat.id, 'https://jut.su/summertime/episode-8.html')
except Exception as e:
print(repr(e))
bot.polling(none_stop=True)