From d9246da01ea2237bd1caf91d5bf5cab9466ab24b Mon Sep 17 00:00:00 2001 From: TechiError Date: Sat, 19 Aug 2023 18:17:18 +0530 Subject: [PATCH] Update drive.py --- plugins/drive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/drive.py b/plugins/drive.py index 67494961d..185c969d9 100644 --- a/plugins/drive.py +++ b/plugins/drive.py @@ -12,6 +12,8 @@ async def drive_upload_func(event): """`{}gdul ` - Upload file from local/telegram to Google Drive.""" match = event.pattern_match.group(2) + if not drive.creds.get("access_token"): + return await event.eor("Please authorise with Gdrive before uploading.") reply = await event.get_reply_message() xx = await event.eor("`Processing...`") if reply: @@ -39,6 +41,8 @@ async def drive_download_func(event): @ultroid_cmd("gdusg$") async def drive_usage_func(event): """`{}gdusg` - Show total limit and usage of Google Drive storage.""" + if not drive.creds.get("access_token"): + return await event.eor("Please authorise with Gdrive before using gdrive.") size = await drive.get_size_status() size = size["storageQuota"] await event.eor(