Skip to content

Commit

Permalink
Update drive.py
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhhu authored Aug 18, 2023
1 parent 712afb9 commit 026ca07
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ async def drive_auth_func(event):
"""`{}gdauth <code>` - 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."
Expand Down

0 comments on commit 026ca07

Please sign in to comment.