A microframework between google app script(GAS) and telegram API for simple telegram Bots (Typescript Version)
Glosary gas = google app script
One time for all bots
- configure typescript
- configure node-google-apps-script
First time when create each bot
- clone this repo
- create in https://script.google.com your project
- create bot in https://web.telegram.org/#/im?p=@BotFather
- paste project_name,id_gapps, secret in _config.ts
googleAppScript:
project_name : ""
id_gapps : ""
secret:""
project_name : the name of the the project in de gas editor
id_gapps: from "https://script.google.com/d/**ID_GAPPS IS HERE**/edit?splash=yes"
secret: in BotFather the token to access :
Ex. 22465655206:ZYGPndgYE5Ejs8e6_9pujKywTgHKDvGu-Cp
-
run (into proyect folder)
node pull.js
-
edit frontend/commands.ts
-
edit test/frontend.ts
-
run (into proyect folder)
node push.js
-
go to Publish > Deploy as web app. Guide
- Execute the app as your username
- Who has access to the app "Anyone, even anonymous"
- Click Deploy.
- Will show a url (the url should look like this https://script.google.com/macros/s/*****/exec)
-
in gas editor run
setTelegram
function in init file -
profit!
When edit
-
run (into proyect folder)
node push.ts
-
edit frontend/commands.ts
-
edit test/frontend.ts
-
run (into proyect folder)
node push.ts
-
go to Publish > Deploy as web app. Guide
- Execute the app as your username
- Who has access to the app "Anyone, even anonymous"
- Click Deploy.
- Will show a url (the url should look like this https://script.google.com/macros/s/*****/exec)
-
in the gas editor run
setTelegram
(init.gs) function in init file -
profit!