Live example here @MemoryManagerBot.
- Create some categories
├── 🏛 num- "1"
├── 🧸 num- "2"
│ └── 🏘 "2.1"
├── 🏠 num- "3"
│ └── 🧮 "3.1"
└── 🚗 num- "4"
└── ⛽️ "4.1"
- Track some data into categories
- Obtain your monthly(any timeframe) budget
Total: +81,853.7 (+201,564) (-119,710.3)
├── 💊: -19,000
├── 🍎: -18,090
├── 🧸: -8,247
├── 👚: -7,469
├── 🛒: -19,955.71
├── 🏠: -6,319.21
│ └── 🧮: -5,541.21
├── 🌐: -11,459.76
├── 🏪: -7,140.06
├── 🍽: -2,635.91
├── 🚗: -3,712.77
│ └── ⛽️: -3,712.77
├── 💻: -2,097
├── 🏛: -8,966.88
├── 🎉: -4,617
└── 💰: +201,564
Balance till 18.11.2022 12:41:05 is +291,909.88
- Track some text data for whatever reason
- install NodeJS, PostgreSQL
- run
npm i
- create
memory
(by default) database forPostgreSQL
- create application at
https://my.telegram.org/apps. Select
application type -
Web
, set -empty URL
, obtainapi id
andapi hash
. - create Telegram Bot with BotFather
- build tdLib for your system, check required version with airgram
- create
.app_rc.json
config file
Build npm run build
and run bot npm start
or cd ./dist
and node app.js
- use bot in private chat or add bot to chat with multiple users (assign bot admin rights to read all messages for better UX)
TdLib can be used for bot and user. TelegramBotAPI is limited to bots only. Moreover TelegramBotAPI does not support a lot of handy methods, e.g. fetch message by id etc.
- NodeJS+TypeScript has awesome package for TdLib - Airgram.
- NodeJS+TypeScript has awesome package for TelegramBotAPI - Telegraf.
Currently TdLib has only one huge minus for NodeJS - you have to build TdLib, but this can change in the future using WASM.
Configuration file is required. See additional info, about
cosmiconfig package. Configuration
example .app_rc.example.json
. You need to create your own config file e.g.
.app_rc.json
by default.
Path to the application config
CONFIG=... node app.js
Debug anything (see all possible values logger.ts)
DEBUG=bnb* node app.js
For testing you need to have test_section
in config file.
Jest performs tests.
- Run tests
npm run test
- Run unit tests
npm run test-unit
- Run integration tests
npm run test-int