1.0.9 • Published 9 years ago

simple-telegram-bot v1.0.9

Weekly downloads
16
License
ISC
Repository
github
Last release
9 years ago

Example app

var config = require("./example-config.json");

var token = config.botToken,
    connectionString = config.connectionString;

var Bot = require("node-telegram-bot-api"),
    bot = new Bot(token, { polling: true }),
    Massive = require("massive"),
    db = Massive.connectSync({ connectionString: connectionString }),
    SimpleBot = require('simple-telegram-bot'),
    simpleBot = new SimpleBot(bot, db.users, "echo");

simpleBot.on("chatstarted", function(chat){

    chat.send("Say something!");

    chat.on("command:echo", function(message){
        chat.send(message.text);
    });

    chat.on("command:broadcast", function(message){
        simpleBot.broadcast(message.text);
    });
    
});

Example config

{
    "botToken": "123123123:ABCABCABCABCABCABCABC-ABCABCABCABCA",
    "connectionString": "postgres://username:password@localhost/databasename"
}
1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago