# 30-lines-telegram-bot

> Telegram bot in 30 lines of code

Latest version **1.0.1** (published 2024-03-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install 30-lines-telegram-bot
pnpm add 30-lines-telegram-bot
yarn add 30-lines-telegram-bot
bun add 30-lines-telegram-bot
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-03-14 |
| First published | 2024-03-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 36.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 20dec |
| Maintainers | 20dec |
| Keywords | TELEGRAM, BOT |

## Links

- npm: https://www.npmjs.com/package/30-lines-telegram-bot
- Repository: https://github.com/20dec/30-lines-telegram-bot
- Homepage: https://github.com/20dec/30-lines-telegram-bot#readme
- Issues: https://github.com/20dec/30-lines-telegram-bot/issues
- npm.io page: https://npm.io/package/30-lines-telegram-bot

## Dependencies (5)

- [request](https://npm.io/package/request.md) 2.83.0
- [mexcpricebot](https://npm.io/package/mexcpricebot.md) 1.0.0
- [binancepricebot](https://npm.io/package/binancepricebot.md) 1.0.2
- [crypto-price-api](https://npm.io/package/crypto-price-api.md) 1.0.0
- [node-telegram-bot-api](https://npm.io/package/node-telegram-bot-api.md) 0.29.0

## Recent versions

- 1.0.1 (latest) — 2024-03-14
- 1.0.0 — 2024-03-14

## README

![Logo](https://github.com/tryshchenko/30-lines-telegram-bot/raw/master/icon.png)
# 2Space - Telegram Bot in 30 Lines of Code Example
You can try it out on telegram - @tospace

This telegram bot is a little bit more than standard "Hello World" application - it does something. It gets the information about closest launches of spacecrafts.

### This library was created to illustrate a bot creation process as simple as it possible.

I have created it as a demo for my presentation on IT NonStop Wroclaw. Links and descriptions are going to be provided when event will happen.

## Environment
It works literally everywhere. Server is not mandatory - it works well from your personal device.

## Running
1. Register your bot with @botfather. It will give you a token
2. Create token file: `cp token-example.js token.js`
3. Place your token string inside
4. `npm install`
5. `npm start`
6. Enjoy. Just type your bot a message in telegram

## Warning
It is not production ready solution (I know, it's obvious, but...). In real life it makes sense to use a way more complicated algorithms of language recognition, not `indexOf`. Also in real life it's a very bad idea to hardcore URLs like it's done in the example. Only morons do so on real projects.
Storing cases in one folder is not a good practice either, some architecture is very helpful. Just imagine it's kind of router and cases are action of controllers - with such abstraction life is way easier.

## Credentials
Data is provided by API - https://launchlibrary.net
Icon used for application was taken here https://www.flaticon.com/authors/smashicons

Project uses 2 libraries: node-telegram-bot-api and request.

### Thank you for checking this page.

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