https://github.com/frenchbread/didactic-quack
:pencil: Bot that works through Telegram Bot API.
https://github.com/frenchbread/didactic-quack
Last synced: 10 months ago
JSON representation
:pencil: Bot that works through Telegram Bot API.
- Host: GitHub
- URL: https://github.com/frenchbread/didactic-quack
- Owner: frenchbread
- License: mit
- Created: 2015-11-19T20:00:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-13T15:34:49.000Z (almost 10 years ago)
- Last Synced: 2025-03-15T12:18:07.523Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# didactic-quack
Wrapper around [Telegram](https://telegram.org/) messenger API.

### Installation & setup
1. Download [Telegram app](https://telegram.org/apps) and set it up.
2. Text to [@BotFather](https://telegram.me/botfather) and follow instructions to create a new bot & get `api_token`.
See Official docs for [Bot API](https://core.telegram.org/bots).
3. Install npm package.
```
$ npm i didactic-quack --save
```
## Usage
#### In `app.js`:
```javascript
var DQ = require('didactic-quack');
var dq = new DQ({
"token": "your_telegram_bot_api_token"
});
setInterval(function () {
dq.getUpdates();
}, 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 | | ` - returns logged data. (Does not do more. Only parses data and returns in user-friendly way).
`` - `String`
`` - `Double`
`` - `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](https://github.com/frenchbread/didactic-quack/blob/master/LICENSE.md).