def create_keyboard(self, window=0):
self.files = self.ls()
self.files.insert(0, [InlineKeyboardButton('OPEN TERMINAL HERE',
callback_data=' t')])
if len(self.files) <= 52:
return self.files
start = 0 if window == 0 else window * 50
stop = start + 50
head = None if start == 0 else (InlineKeyboardButton("<<<PREVIOUS<<<",
callback_data="{}w".format(window-1)))
foot = None if stop > len(self.files) else (InlineKeyboardButton(">>>NEXT>>>",
callback_data="{}w".format(window+1)))
kb = build_menu(self.files[start:stop], header=head, footer=foot)
return kb
评论列表
文章目录