{"id":21807556,"url":"https://github.com/muety/telegram-expense-bot","last_synced_at":"2025-08-18T04:32:36.017Z","repository":{"id":45188187,"uuid":"73831290","full_name":"muety/telegram-expense-bot","owner":"muety","description":"A bot that helps you manage and track your daily expenses.","archived":true,"fork":false,"pushed_at":"2024-11-09T23:47:41.000Z","size":853,"stargazers_count":63,"open_issues_count":7,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-16T19:34:20.556Z","etag":null,"topics":["expense-tracker","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muety.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-15T16:11:36.000Z","updated_at":"2025-01-14T10:38:05.000Z","dependencies_parsed_at":"2024-02-25T09:27:18.877Z","dependency_job_id":"50ce39ad-6e09-45fc-84eb-81c0cb781899","html_url":"https://github.com/muety/telegram-expense-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muety/telegram-expense-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muety%2Ftelegram-expense-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muety%2Ftelegram-expense-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muety%2Ftelegram-expense-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muety%2Ftelegram-expense-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muety","download_url":"https://codeload.github.com/muety/telegram-expense-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muety%2Ftelegram-expense-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270945171,"owners_count":24672873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expense-tracker","telegram","telegram-bot"],"created_at":"2024-11-27T12:45:48.787Z","updated_at":"2025-08-18T04:32:35.753Z","avatar_url":"https://github.com/muety.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"botfather/logo.png\" width=\"200\"\u003e\n\u003c/p\u003e\n\n# 🤖 telegram-expense-bot\nThis is a bot for the [Telegram](https://telegram.org/) messaging app using their [bot platform](https://core.telegram.org/bots). The code is open-source and consequently anybody could set up an own instance of the bot. To learn how to do so, see [this section](#how-to-host-it-myself). The official hosted version is available as [@ExpenseBot](https://telegram.me/ExpenseBot). To learn more about this bot, please refer to [this blog article](https://ferdinand-muetsch.de/telegram-expensebot-doodlerbot.html) or just send the bot a message with the `/help` command.\n\n![](https://anchr.io/i/rbtPU.png)\n\n## What does it do?\nThis bot’s purpose is to help people manage their daily expenses and keep track of their financial situation. Users can add expenses from wherever they are using a few simple commands from within the chat and have an eye on how much they have spent in a month or a day. This obviates the need for confusing Excel spreadsheets or paper notes. \n\n## Initial setup\nWhen you first start using the bot, please send it your current location as a message, so the bot is aware of your time zone and can handle dates properly for you.\n\n## How to host it myself?\n### Prerequisites\nIn order to host this bot on your own, you need a few things.\n* Server to run the bot on (since the bot uses the long polling method to [get updates](https://core.telegram.org/bots/api/#getupdates) instead of the web-hook one, you don't need HTTPS certificates or ports to be exposed)\n* Node.js \u003e= 20\n* A MongoDB database (you can use [mlab.com](http://mlab.com) to get a free, hosted MongoDB)\n* A bot token, which you get from registering a new bot to the [@BotFather](https://telegram.me/BotFather)\n\n### Configuration\nTo configure your bot, clone this repository, copy `config.example.json` to `config.json` and edit it.\n\n| **Property**            | **Default**   | **Required** | **Description**                                                                                                                       |\n|-------------------------|---------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `BOT_TOKEN`             | `-`           | Yes          | Your bot's token (received from BotFather).                                                                                           |\n| `PUBLIC_URL`            | `-`           | Webhook only | URL at which your bot is publicly available (for Telegram to send updates). Required in webhook mode. Ex.: `https://bot.example.org`. |\n| `DB_URL`                | `-`           | Yes          | MongoDB database connection string (starting with `mongodb://`)                                                                       |\n| `DB_COLLECTION`         | `expenses`    | No           | MongoDB collection for storing expenses                                                                                               |\n| `BIND_IPV4`             | `127.0.0.1`   | Webhook only | Address where to listen for HTTP requests                                                                                             |\n| `PORT`                  | `3010`        | Webhook only | Port where to listen for HTTP requests                                                                                                |\n| `BOT_NAME`              | ``            | Yes          | The bot's name                                                                                                                        |\n| `BOT_TELEGRAM_USERNAME` | ``            | Yes          | The bot's actual unique Telegram username                                                                                             |\n| `ADMIN`                 | `[]`          | Yes          | List of Telegram user IDs to grant admin access                                                                                       |\n| `RATE_LIMIT`            | `250`         | No           | Maximum number of messages per hour per user                                                                                          |\n\n\n### Install\n```bash\n$ yarn\n```\n\n### Run\n```bash\n$ yarn start:production\n```\n\n## Metrics\nWhen using webhook mode, [Prometheus](https://prometheus.io) metrics are exposed at `/metrics`.\n\n## Database\n```javascript\ndb.expenses.createIndex({ \"user\": 1 }, { name: \"idx_user\" });\ndb.expenses.createIndex({ \"user\": 1, \"isTemplate\": 1, \"timestamp\": 1, \"category\": 1 }, { name: \"idx_full_query\" });\ndb.expenses.createIndex({ \"isTemplate\": 1, \"user\": 1 }, { name: \"idx_template_user\" });\ndb.expenses.createIndex({ \"isTemplate\": 1, \"user\": 1, \"timestamp\": 1 }, { name: \"idx_template_user_time\" });\ndb.expenses.createIndex({ \"ref\": 1 }, { name: \"idx_ref\" });\n```\n\n## License\nMIT @ [Ferdinand Mütsch](https://muetsch.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuety%2Ftelegram-expense-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuety%2Ftelegram-expense-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuety%2Ftelegram-expense-bot/lists"}