0.3.0 • Published 3 years ago

small-simple-bot v0.3.0

Weekly downloads
27
License
AGPL-3.0
Repository
-
Last release
3 years ago

Small Simple Bot

A Really simple Telegram Bot

Usage

In your desktop / Local network

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

In a server

Write my-bot.coffee:

SmallSimpleBot = require 'small-simple-bot'

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

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

server = do require('http').createServer

bot.bindServer server

server.listen process.env.PORT or 3000

Create an interation module

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
0.3.0

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.14

4 years ago

0.1.0

4 years ago

0.0.13

4 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.9

5 years ago

0.0.7

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago