import telebot
from telebot import types
bot = telebot.TeleBot('TOKEN', parse_mode=None)
@bot.message_handler(commands=['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=None)
t1 = types.KeyboardButton('Сольные песни')
t2 = types.KeyboardButton('Дуэты')
markup.add(t1, t2)
bot.send_message(message.chat.id, 'Выбери вид песни:', reply_markup=markup)
@bot.message_handler(content_types=['text'])
def music(message):
if message.text == 'Сольные песни':
markup2 = types.ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=None, row_width=5)
types1 = types.KeyboardButton('Абдулкадыр')
types2 = types.KeyboardButton('Аварцы')
types3 = types.KeyboardButton('Без тебя жизнь не нужна')
types4 = types.KeyboardButton('Без тебя одиноко')
types5 = types.KeyboardButton('Без тебя')
markup2.add(types1, types2, types3, types4, types5)
bot.send_message(message.chat.id, 'Выбери песню:', reply_markup=markup2)
elif message.text == 'Дуэты':
bot.send_message(message.chat.id, 'Пока обрабатывается')
@bot.message_handler(content_types=['text'])
def start2(message):
if message.text == 'Абдулкадыр':
bot.send_audio(message.chat.id, open(r'music\solo\Абдулкадыр.mp3', 'rb'))
bot.send_message(message.chat.id, 'Песня отправлена')
elif message.text == 'Аварцы':
bot.send_audio(message.chat.id, open('music\solo\Аварцы.mp3', 'rb'))
bot.send_message(message.chat.id, 'Песня отправлена')
elif message.text == 'Без тебя жизнь не нужна':
bot.send_audio(message.chat.id, open('music\solo\Без тебя жизнь не нужна.mp3', 'rb'))
bot.send_message(message.chat.id, 'Песня отправлена')
elif message.text == 'Без тебя одиноко':
bot.send_audio(message.chat.id, open('music\solo\Без тебя одиноко.mp3', 'rb'))
bot.send_message(message.chat.id, 'Песня отправлена')
elif message.text == 'Без тебя':
bot.send_audio(message.chat.id, open('music\solo\Без тебя.mp3', 'rb'))
bot.polling(none_stop=True)