0.3.1 • Published 10 years ago

didactic-quack v0.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

didactic-quack

Wrapper around Telegram messenger API.

NPM Stats

Installation & setup

  1. Download Telegram app and set it up.

  2. Text to @BotFather and follow instructions to create a new bot & get api_token.

    See Official docs for Bot API.

  3. Install npm package.

    $ npm i didactic-quack --save

Usage

In app.js:

var DQ = require('didactic-quack');
       
var dq = new DQ({
    "token": "your_telegram_bot_api_token"
});

setInterval(function () {

    dq.getUpdates(function (err, res) {
        console.log(res);
    });

}, 3000);

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).

License

MIT license.

0.3.1

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago