From 026ca07dd18c9655e191935eec9c22e4fcae69fa Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Fri, 18 Aug 2023 23:00:39 +0530 Subject: [PATCH] Update drive.py --- plugins/drive.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/drive.py b/plugins/drive.py index c11f1e333..301aadeb7 100644 --- a/plugins/drive.py +++ b/plugins/drive.py @@ -35,11 +35,10 @@ async def drive_auth_func(event): """`{}gdauth ` - To authorise with Google Drive API. Args: `code` - Code which you get after visiting the link provided by `{}gdauth`""" - drive = GDrive() match = event.pattern_match.group(1) - if not (drive.client_id or drive.client_secret): - return await event.eor("Fill GDrive credentials before authorisation.") if not match: + if not (drive.client_id or drive.client_secret): + return await event.eor("Fill GDrive credentials before authorisation.") return await event.eor(f"Visit [this]({drive.get_oauth2_url()}) to get authorisation code.") creds = await drive.get_access_token(code=match) msg = "Authorisation successful."