Git Product home page Git Product logo

shared-gdrive-bot's Introduction

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.