# small-simple-bot

> Really simple telegram bot

Latest version **0.3.0** (published 2021-07-07) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install small-simple-bot
pnpm add small-simple-bot
yarn add small-simple-bot
bun add small-simple-bot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-07-07 |
| First published | 2018-12-29 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 44.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Aurélio A. Heckert |
| Maintainers | aurium |

## Links

- npm: https://www.npmjs.com/package/small-simple-bot
- npm.io page: https://npm.io/package/small-simple-bot

## Dependencies (4)

- [request](https://npm.io/package/request.md) ^2.85.0
- [coffeescript](https://npm.io/package/coffeescript.md) ^2.3.0
- [html-entities](https://npm.io/package/html-entities.md) ^1.2.1
- [html-minifier](https://npm.io/package/html-minifier.md) ^4.0.*

## Recent versions

- 0.3.0 (latest) — 2021-07-07
- 0.2.0 — 2021-07-07
- 0.1.9 — 2021-04-04
- 0.1.7 — 2021-02-20
- 0.1.6 — 2020-11-23
- 0.1.4 — 2020-09-17
- 0.1.3 — 2020-09-17
- 0.1.2 — 2020-09-16
- 0.1.1 — 2020-09-16
- 0.1.0 — 2020-09-16
- 0.0.14 — 2020-09-16
- 0.0.13 — 2020-06-08
- 0.0.12 — 2019-10-21
- 0.0.11 — 2019-08-23
- 0.0.9 — 2019-07-25
- … 6 more at https://npm.io/package/small-simple-bot/versions

## README

Small Simple Bot
================

A Really simple Telegram Bot

Usage
-----

### In your desktop / Local network

Write `my-bot.coffee`:
```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`:
```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`:
```coffee
module.exports = (bot, update)->
    msg = update.message?.text or ''
    if update.toMe and msg
        bot.sendMessage "You said #{msg}", update.message.chat.id
```

---
_Source: https://npm.io/package/small-simple-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
