Added Authorization for Drive List Command.
This commit is contained in:
parent
0850c41d4d
commit
7c4779cfc6
|
|
@ -2,6 +2,7 @@ from telegram.ext import CommandHandler, run_async
|
||||||
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
|
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
|
||||||
from bot import LOGGER, dispatcher
|
from bot import LOGGER, dispatcher
|
||||||
from bot.helper.telegram_helper.message_utils import auto_delete_message, sendMessage
|
from bot.helper.telegram_helper.message_utils import auto_delete_message, sendMessage
|
||||||
|
from bot.helper.telegram_helper.filters import CustomFilters
|
||||||
import threading
|
import threading
|
||||||
from bot.helper.telegram_helper.bot_commands import BotCommands
|
from bot.helper.telegram_helper.bot_commands import BotCommands
|
||||||
|
|
||||||
|
|
@ -20,5 +21,5 @@ def list_drive(bot,update):
|
||||||
threading.Thread(target=auto_delete_message, args=(bot, update.message, reply_message)).start()
|
threading.Thread(target=auto_delete_message, args=(bot, update.message, reply_message)).start()
|
||||||
|
|
||||||
|
|
||||||
list_handler = CommandHandler(BotCommands.ListCommand, list_drive)
|
list_handler = CommandHandler(BotCommands.ListCommand, list_drive,filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
|
||||||
dispatcher.add_handler(list_handler)
|
dispatcher.add_handler(list_handler)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue