Skip to content

Commit

Permalink
Update drive.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TechiError authored Aug 19, 2023
1 parent 2b87fb6 commit d9246da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
async def drive_upload_func(event):
"""`{}gdul <path to file/reply to file>` - 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:
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d9246da

Please sign in to comment.