small-simple-bot
Really simple telegram bot
Last updated 7 months ago by aurium .
AGPL-3.0 · Original npm · Tarball · package.json
$ cnpm install small-simple-bot 
SYNC missed versions from official npm registry.

Small Simple Bot

A Really simple Telegram Bot

Usage

Write my-bot.coffee:

SmallSimpleBot = require 'small-simple-bot'

bot = new SmallSimpleBot
    token: '123456789:YourBotsTelegramToken'
    adms: [
        { username: 'aurium', id: 123456789 }
        { username: 'diguliu', id: 987654321 }
    ]

bot.addInteractions(
    require './my-interaction-module'
    require './other-interaction-module'
)

do bot.run

Write my-interaction-module.coffee:

module.exports = (bot, update)->
    msg = update.message?.text or ''
    if update.toMe and msg
        bot.sendMessage "You said #{msg}", update.message.chat.id

Current Tags

  • 0.0.12                                ...           latest (7 months ago)

9 Versions

  • 0.0.12                                ...           7 months ago
  • 0.0.11                                ...           9 months ago
  • 0.0.9                                ...           10 months ago
  • 0.0.7                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 2
Last Month 11
Dependencies (4)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |