A Telegram bot for tracking personal finances, expenses, and income with AI-powered insights.
- 📊 Track expenses and income
- 💰 Set budgets and financial goals
- 📈 Generate financial reports
- 🤖 AI-powered financial advice
- 📱 Easy-to-use Telegram interface
- Node.js (v16 or higher)
- Telegram account
- Bot token from @BotFather
-
Clone or download this project
-
Install dependencies:
npm install
-
Set up your Telegram bot:
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Choose a name for your bot (e.g., "Finance Tracker Bot")
- Choose a username ending with "bot" (e.g., "finance_tracker_bot")
- Copy the bot token provided
-
Configure the bot:
- Copy
config.example.jstoconfig.js - Replace
your_bot_token_herewith your actual bot token - Or set the
BOT_TOKENenvironment variable
- Copy
# Production mode
npm start
# Development mode (with auto-restart)
npm run dev
# Direct bot file
npm run bot/start- Start the bot and see welcome message/help- Show help and available commands/expense <amount> <description>- Add an expense/income <amount> <description>- Add income/balance- Check current balance/report- Generate financial report
/expense 25.50 coffee
/income 1000 salary
/balance
The bot can be configured through:
- Environment variables (recommended for production)
config.jsfile (for development)
BOT_TOKEN=your_bot_token_here
OPENAI_API_KEY=your_openai_api_key_here
NODE_ENV=productionfinance-bot/
├── bot.js # Main bot logic and commands
├── index.js # Entry point
├── config.example.js # Configuration template
├── package.json # Dependencies and scripts
└── README.md # This file
Edit bot.js and add new command handlers:
bot.command('newcommand', (ctx) => {
ctx.reply('New command response!');
});- Financial data storage (database integration)
- OpenAI integration for financial advice
- Budget tracking and alerts
- Financial analytics and charts
-
Bot not responding:
- Check if the bot token is correct
- Ensure the bot is running (
npm start) - Check console for error messages
-
"Unauthorized" error:
- Verify your bot token from @BotFather
- Make sure the token is correctly set in config or environment
-
Dependencies not found:
- Run
npm installto install missing packages
- Run
Feel free to contribute by:
- Adding new features
- Improving existing functionality
- Fixing bugs
- Enhancing documentation
ISC License - feel free to use this project for personal or commercial purposes.
If you encounter any issues:
- Check the console output for error messages
- Verify your bot token and configuration
- Ensure all dependencies are properly installed
Happy Finance Tracking! 💰📊