A Telegram Bot for Telebite conv.
Thanks to: node-telegram-bot Thanks to: node-telegram-bot-api
TODO TO BE MODIFIED
- Clone/Download/Fork the repository
npm install
- Create a Bot Account
- Get the associated token (https://core.telegram.org/bots/#botfather)
- Edit config.js
- Set
telegramToken
with the auth token of your bot - Edit
activePlugins
if you want to edit the active plugins. It is an array of the filenames of the active plugins.
- Set
- Run the bot
node bot.js
- Stop it at any time with CTRL+C
Plugins can be easly written with a basic understanding of Javascript.
Check the plugins
folder to see the available plugins and check each file to see a basic explanation.
- Take a look at the provided plugins in the
plugins
folder - Create a
.js
file in theplugins
folder
Basic Skeleton
var pluginName = function(){
this.init = function(){
//this will be executed when the bot starts
};
this.doStop = function(){
//this will be executed when the bot shuts down
};
this.doMessage = function (msg, reply) {
//this will be executed whenever your bot get a message
/*
1. Check if the msg.text matches the trigger for your plugin
2. Do stuff you need
3. Produce reply
replyText = {type:"text", text:"Message you want to post"}
replyAudio = {type:"audio", audio:"path/to/audio.mp3"}
4. Post the reply
reply(replyText); //for example
*/
};
};
module.exports = pluginName;
- Better way to handle plugins (?), I need suggestion on this
- Common utilities module (downloading file, downloading web page, ...)
- Improve the code
- More plugins
- TTS
- Fix random exceptions that sometimes happens
- SET
- Check if the database file exists before saving/loading
Did you made a plugin you want to share with everyone?
Submit a pull request!
This project will only grow if YOU help!