def song_keyboard(data, inline=False):
if not data:
return
keyboard = [[]]
keyboard[-1].append(InlineKeyboardButton(text=Emoji.SCROLL + _('Lyrics'),
callback_data='ly|{}'.format(data['id'])))
# TODO: Add "Artist Info" button to inline
# If it's from an entry search we get pVs instead of pvServices
if 'pVs' in data:
data['pvServices'] = ', '.join([x['service'] for x in data['pVs']])
if not data['pvServices'] == 'Nothing':
keyboard.append([])
for service in PV_SERVICES:
if service in data['pvServices']:
callback_data = 'pv|{}|{}'.format(data['id'], service)
keyboard[-1].append(InlineKeyboardButton(text=Emoji.MOVIE_CAMERA + service,
callback_data=callback_data))
keyboard.append([
InlineKeyboardButton(text=_('Share song'), switch_inline_query='!s#{}'.format(data['id'])),
InlineKeyboardButton(text=_('View on VocaDB.net'), url=vocadb_url(data, song=True))
])
return InlineKeyboardMarkup(keyboard)
# noinspection PyTypeChecker
评论列表
文章目录