Shubhamrawat5 / shared-gdrive-bot

Telegram bot to send direct links of files in google shared drive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shared-gdrive-bot

To create a telegram bot to send your google shared drive files direct links to your telegram channel.

Enable google drive api

1- Go to https://console.cloud.google.com/

login and create a new project

2- Search "Google Drive API" and enable it

3- In "OAuth consent screen" , fill details with (Testing, External, Add Test users -> your gmail accounts)

4- In "Credentials" , Create new "OAuth 2.0 Client IDs" with

Authorised JavaScript origins (Url from which authorization request will come) -> http://localhost

Authorised redirect URIs (Url after authorization will open) -> http://localhost/getToken

NOTE: change localhost URLs to your hosting url like yourapp.herokuapp.com/getToken in redirect URLs

5- Download your OAuth 2.0 Client json file and change its name to "credentials.json" and place it in your repo folder

TG Bot

1- Create Telegram bot from BotFather and get token

2- Create a local ".env" file with

token = your-bot-token

Run

git clone https://github.com/Shubhamrawat5/shared-gdrive-bot.git

cd shared-gdrive-bot

npm install

node app.js

Now http://localhost will show "api running" if everything is ok!

Now open http://localhost/getAuthURL will give Oauth gmail authentication then give permission and it will redirect to a page that will show "token accepted" and bot will start running!

About

Telegram bot to send direct links of files in google shared drive


Languages

Language:JavaScript 100.0%