css-telegram-bot-api
Version:
Now you can write Telegram bots in CSS.
73 lines (50 loc) • 1.73 kB
Markdown
# css-telegram-bot-api
[](https://www.npmjs.com/package/css-telegram-bot-api)
[](https://github.com/Bannerets/css-telegram-bot-api)
[](https://standardjs.com)
[](https://github.com/Bannerets/css-telegram-bot-api/blob/master/LICENSE)
Now you can write Telegram bots in CSS.
## Installation
#### Requirements
- node v6.0.0+
```console
$ [sudo] npm i -g css-telegram-bot-api
```
## Usage
```console
$ css-telegram-bot [options] <path/to/css/file>
```
**or**
```console
$ css-telegram-bot-api [options] <path/to/css/file>
```
## Example
```css
[tg-root] {
/* Replace the value below with the API token you receive from Bot Father */
tg-token: 254259451:AA5cAlGQj51K9AD37v_522HC-5lFgB;
}
[tg-command="/start"] {
tg-method: sendMessage text Start;
/* example: */
/* tg-method: methodName param1 value1 param2 value2; */
}
[tg-command="/help"] {
tg-method: sendMessage text 'Help 1';
}
[tg-command="/echo (.+)"], .tg-regex {
/* echobot */
tg-method: sendMessage text $1;
}
[tg-command="/photo"] {
tg-method: sendPhoto photo https://www.w3.org/html/logo/downloads/HTML5_Badge_64.png;
}
[tg-command="/hello"] {
tg-method: sendMessage text "Hello, world!";
}
```
## Related
* [html-telegram-bot-api](https://github.com/Bannerets/html-telegram-bot-api)
## CLI Options
- `-V`, `--version` - output the version number
- `-h`, `--help` - output usage information