didactic-quack
Wrapper around Telegram messenger API.
Installation & setup
-
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
Usage
app.js
:
In var DQ = ; var dq = "token": "your_telegram_bot_api_token"; ;
Run:
$ node app.js
Commands:
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
.
Default commands:
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
Changelog:
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.
ToDo:
- Set up a web hook for a bot to receive new messages automatically. (Get rid of "manual" requests to the server).