Wrapper around Telegram messenger API.
-
Download Telegram app and set it up.
-
Text to @BotFather and follow instructions to create a new bot & get
api_token
.See Official docs for Bot API.
-
Install npm package.
$ npm i didactic-quack --save
var DQ = require('didactic-quack');
var dq = new DQ({
"token": "your_telegram_bot_api_token"
});
setInterval(function () {
dq.getUpdates();
}, 3000);
$ node app.js
Command implementations are stored in Modules
. All modules should be registered in modulesList.js
for bot to
recognise them and referenced in modules/index.js
.
Text this commands directly to you newly created bot.
-
/time
- returns current time. -
/log <project> | <hours> | <details>
- returns logged data. (Does not do more. Only parses data and returns in user-friendly way).
<project>
- String
<hours>
- Double
<details>
- String
v0.3.0
- Refactored almost all. Added modules. Offset now stored in memory.
v0.2.2
- Fixed path to offset.txt
.
v0.2.0
- Removed Cron
& Mongoose
. Code cleanup. Changed project structure.
- Set up a web hook for a bot to receive new messages automatically. (Get rid of "manual" requests to the server).