MCPcopy Index your code
hub / github.com/Orenoid/telegram-account-bot

github.com/Orenoid/telegram-account-bot @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
337 symbols 854 edges 41 files 148 documented · 44%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

English | 简体中文

Telegram Accounting Bot

This is a Telegram accounting bot that can help you record expenses and income.

Deployment

  1. Install Docker and Docker Compose.
  2. Clone this repository to your local machine.
  3. Rename all .example files in the env directory to .env files and modify configurations such as the database name and password as needed.
  4. In the renamed bot.env file, change the TELEBOT_TOKEN to your own Telegram Bot Token.
  5. Navigate to the project directory in the terminal and run docker-compose up -d to start the containers. If you don't need the OpenAPI feature, you can run docker-compose up -d bot instead.
  6. Open Telegram, search for your bot, and start using it.

Usage

Here are the currently available commands:

  • /start - Start using the bot
  • /day - View today's bill
  • /month - View this month's bill
  • /set_keyboard - Set quick access keyboard
  • /cancel - Cancel the current operation
  • /set_balance - Set the balance
  • /balance - Check the balance
  • /create_token - Create a token for OpenAPI
  • /disable_all_tokens - Disable all tokens

TODO

  • [x] Automatically update Bot Commands
  • [x] Open API
  • [ ] Multilingual
  • [ ] Natural language interface

Extension points exported contracts — how you extend this code

Template (Interface)
(no doc) [4 implementers]
telebot/templates.go
UserStateManager (Interface)
(no doc) [3 implementers]
telebot/user_state.go
Repository (Interface)
(no doc)
dal/telegram/repository.go
Repository (Interface)
(no doc)
dal/user/repository.go
Repository (Interface)
(no doc)
dal/bill/repository.go

Core symbols most depended-on inside this repo

Sender
called by 18
mock/telebotmock/mock.go
Send
called by 18
telebot/senders.go
EXPECT
called by 13
mock/telebotmock/mock.go
EXPECT
called by 12
dal/user/mock.go
Render
called by 11
telebot/templates.go
GetBaseUserID
called by 10
service/telegram/telegram.go
Text
called by 9
telebot/senders.go
CheckUserExists
called by 8
dal/user/repository.go

Shape

Method 218
Function 60
Struct 51
Interface 5
TypeAlias 3

Languages

Go100%

Modules by API surface

mock/telebotmock/mock.go78 symbols
telebot/handlers.go24 symbols
telebot/templates.go21 symbols
dal/user/mock.go20 symbols
telebot/handlers_test.go19 symbols
dal/bill/mock.go12 symbols
telebot/user_state.go11 symbols
dal/user/mysql.go11 symbols
telebot/user_state_mock.go10 symbols
telebot/senders.go10 symbols
dal/user/repository.go9 symbols
telebot/inlines.go8 symbols

For agents

$ claude mcp add telegram-account-bot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact