Upload Files to Google Drive Using a Telegram Bot




 In this blog you will find how to upload files to gdrive using telegram bot





To upload facebook videos using telegram bot click here
To upload youtube videos using telegram bot click here

Bot link: @apiv3_bot



bot commands

/glogin - login with gdrive

/reglogin - re login with gdrive

/regauth - re-auth token

/gupload - upload videos to gdrive


steps

  1. Create a google project
  2. Enable google drive api
  3. Setup OAuth consent screen
  4. Create credentials
  5. Login with bot
  6. upload files to gdrive



Create a google project

Go to the Google Cloud Console at https://console.cloud.google.com/apis/dashboard.
Click on the "Select a Project" dropdown in the top bar and click "New Project".



Enter a name for your project and select the billing account you want to associate with it



Enter your project name and Click the "Create" button.



Enable google drive api

  1. click libraries in left side menu
  2. Search google drive
  3. select Google Drive Api and enable it





Setup OAuth consent screen


click OAuth consent screen in left side menu


Select external then click create




Enter app name , user support email, Developer contact information and click save and continue



now you will see scopes screen you don't need to add anything just press save and continue





Now add your google drive email address as test user




Then press save and continue




Thats all you you successfully setup your OAuth consent screen


Create credentials


Select  Credentials tab in left side menu



Select create Credentials and OAuth client ID




Select desktop app as application type  and click create



Now you will see client is , client secret 






Login with bot


Type /glogin to login with bot





After you logged in you can use /gupload command to upload a file

/gupload <reply to a telegram file or any direct url> 




Thats all now you can upload files to google drive using telegram bot if you have any doubts watch youtube video or ask in comment section