Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dlion/smagenbot
A simple personal Telegram bot plugins based.
https://github.com/dlion/smagenbot
bot node nodejs smagen telegram
Last synced: 4 months ago
JSON representation
A simple personal Telegram bot plugins based.
- Host: GitHub
- URL: https://github.com/dlion/smagenbot
- Owner: dlion
- License: mit
- Created: 2015-06-24T19:36:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-10T23:54:29.000Z (almost 9 years ago)
- Last Synced: 2024-09-23T18:08:12.701Z (4 months ago)
- Topics: bot, node, nodejs, smagen, telegram
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 14
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smagenBot
A simple personal Telegram bot plugins based.## How can I create a personal bot ?
Follow these steps: https://core.telegram.org/bots#3-how-do-i-create-a-bot## Configure smagenBot
Edit config.json
```
token: "YOUR BOT TOKEN",
interval: "everytime it has to check messages"
quiet: true if you want to know when it send a message, false if not
username: false allows your bot to send messages to everyone otherwise put it your username and it will send messages only to you
botname: Your bot nick
```## List of Plugins
To see a list of plugins send `/help` to your bot or list files in `plugins/` directoryCurrently I have made these plugins:
* `/os` - Send to me my OS information
* `/pokemon ` - Send to me informations about `` pokémon
* `/expand ` - Expand a short ``
* `/btc ` - Show quotation of Bitcoin in ``
* `/imdb ` - Show information about a ``
* `/xkcd or ` - Send an image from xkcd## Add a Plugin
* To add a simple plugin you have to add `name.js` file to a `plugins/` directory.
* Follow the examples to make your own plugin.
* Add your plugin command and description to a `list.json` fileThat's all.
To use it send to your bot `/name`.
## How plugins works
Plugins have to put into an `exec` function that have one parameter and returns a callback with 2 parameters:
* The first parameter is an array of objects
* The second parameter is an array of strings. These strings coincide to type of the objects returns.So if for example: if the first object is a text object the first element of the type's array is `"text"`, if the second is a photo object the second element of the type's array is `"photo"` and so on.
## Screenshot
![screen1](http://i.imgur.com/ZM2MzKa.png)## Log Example
```
{"level":"info","message":"Text Sent to .","timestamp":"2016-01-21T14:27:42.668Z"}
```## TODO
- [ ] Start plugin
- [x] Move plugins directory on the root of the repo
- [ ] More plugins
- [x] if use /command@nickname your bot answer only if nickname is his name
- [x] The bot can send images from an url
- [x] The bot can send chatAction
- [ ] The bot can send audio files
- [x] The bot can send videos from an url
- [x] The bot can send documents from an url
- [x] Plugins can send more messages at once (photo, text, etc.)## Author
* Domenico Luciani aka DLion
* http://dlion.it## LICENSE
MIT 2015 Domenico Luciani [email protected]