This is a Python-based Telegram bot that helps users track their spending, income, and account balance. It provides various commands to record expenses, income, and retrieve financial information.
- Record daily spending with notes
- Record daily income with sources
- Retrieve spending and income details for a specific date
- Set and update user's name and email
- Display user's account balance and personal information
- Send spending details to the user's email
- Track the number of messages sent in a chat
- Log chat conversations
Python 3.x
Telegram bot API token (obtain it from @BotFather)
-
Clone the repository to your local machine:
git clone https://github.com/giauphan/botchat-telegram.git
-
Navigate to the project directory:
cd botchat-telegram
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
-
-
Install the project dependencies:
pip install -r requirements.txt
Create a .env file in the root directory
Add your Telegram bot API token: api_token=YOUR_BOT_TOKEN
Configure any other necessary environment variables (e.g., database connection)
Run the bot:
python migration.py
python bot.py
/start - Start the bot and receive a welcome message
/help - Get a list of available commands
/spending - Record daily spending with notes
/expense <amount> <category> - Quickly record an expense with a category
/get_spending - Retrieve spending details for a specific date
/income - Record daily income with sources
/get_income - Retrieve income details for a specific date
/set_email - Set your email address
/set_name - Set your name
/show_info - Display your personal information and account balance
/statistical - Get the number of messages you've sent in the chat
/send_spending - Send your spending details to your registered email
Contributing Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
License This project is licensed under the MIT License.
pip install --force-reinstall 'sqlalchemy<2.0.0'