Telegram bot that can eventually fetch data from user endpoint and send info about fetched data.
Gives access to non-public commands (such as /start
).
Starts eventually sending GET requests to , processing response and printing info to subscribed user. Requests will include Authorization header (see config structure for credentials).
Response structure should be like:
{
"result": {
"message": "Your message",
"entities": [
{
"meta": {
"key": "value",
"anotherKey": 123
}
},
...
]
}
Sends 1 GET request to provided , processing response and printing info to subscribed user. Request will include Authorization header.
Stops sending requests.
- Clone this repo.
git clone git@github.com:qiwi/watch_bot.git
- Make your own config in
config/default.json
orconfig/default.js
{
"general": {
"defaultCronTime": "*/10 * * * * *", // polling cron time
"botTGToken": "*", // bot telegram token - talk to @BotFather at telegram to get it
"numVerboseErrors": 20 // bot will stop printing error message after numVerboseErrors errors in fetching data
"defaultWatchUrl": "https://test" // default watch url for /start and /check commands
},
"auth": {
"method": "JWT", // Authorization header value: <method> <token>
"token": "*" // Authorization header value: <method> <token>
},
"logger": {
"logLevel": "debug"
},
"botAuth": {
"token": "SomeTest" // see /auth command,
"allowedChats": [1111, 2222] // whitelisted chats list (optional)
},
"backupFolder": "./" // folder for backuping active chats data
}
-
npm install
-
npm run build
-
node app
TODO