Fixed /list command
This commit is contained in:
parent
a6e3482878
commit
11e9b2cad6
|
|
@ -8,20 +8,19 @@ from bot.helper.telegram_helper.bot_commands import BotCommands
|
||||||
|
|
||||||
@run_async
|
@run_async
|
||||||
def list_drive(update,context):
|
def list_drive(update,context):
|
||||||
try:
|
if update.message.text == f'/{BotCommands.ListCommand}':
|
||||||
search = update.message.text.split(' ',maxsplit=1)[1]
|
sendMessage(f'Send a search key along with {BotCommands.ListCommand} command', context.bot, update)
|
||||||
LOGGER.info(f"Searching: {search}")
|
message = update.message.text
|
||||||
reply = sendMessage('Searching..... Please wait!', context.bot, update)
|
search = message.split(' ',maxsplit=1)[1]
|
||||||
gdrive = GoogleDriveHelper(None)
|
LOGGER.info(f"Searching: {search}")
|
||||||
msg, button = gdrive.drive_list(search)
|
gdrive = GoogleDriveHelper(None)
|
||||||
|
msg = gdrive.drive_list(search)
|
||||||
|
if msg:
|
||||||
|
reply_message = sendMessage(msg, context.bot, update)
|
||||||
|
else:
|
||||||
|
reply_message = sendMessage('No result found', context.bot, update)
|
||||||
|
|
||||||
if msg:
|
threading.Thread(target=auto_delete_message, args=(context.bot, update.message, reply_message)).start()
|
||||||
editMessage(msg, reply)
|
|
||||||
else:
|
|
||||||
editMessage('No result found', reply)
|
|
||||||
|
|
||||||
except IndexError:
|
|
||||||
sendMessage('Send a search key along with command', context.bot, update)
|
|
||||||
|
|
||||||
|
|
||||||
list_handler = CommandHandler(BotCommands.ListCommand, list_drive,filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
|
list_handler = CommandHandler(BotCommands.ListCommand, list_drive,filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue