The bot will automatically create a config.json file when you first run it. Edit this file with your actual bot token:
{
"telegram_bot": {
"bot_token": "1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi",
"webapp_url": "https://your-webapp-domain.com/index.html"
},
"database": {
"connection_string": "Data Source=simplefin_multi_accounts.db"
}
}Set these environment variables:
$env:TELEGRAM_BOT_TOKEN="your_bot_token_here"
$env:TELEGRAM_WEBAPP_URL="https://your-webapp-domain.com/index.html"
$env:DATABASE_CONNECTION_STRING="Data Source=simplefin_multi_accounts.db"set TELEGRAM_BOT_TOKEN=your_bot_token_here
set TELEGRAM_WEBAPP_URL=https://your-webapp-domain.com/index.html
set DATABASE_CONNECTION_STRING=Data Source=simplefin_multi_accounts.dbexport TELEGRAM_BOT_TOKEN="your_bot_token_here"
export TELEGRAM_WEBAPP_URL="https://your-webapp-domain.com/index.html"
export DATABASE_CONNECTION_STRING="Data Source=simplefin_multi_accounts.db"- Open Telegram and search for
@BotFather - Start a conversation and send
/newbot - Follow the instructions to create your bot
- Copy the bot token provided by BotFather
The Python bot checks for configuration in this order:
- Environment variables (highest priority)
- config.json file (lowest priority)
-
Install dependencies:
cd python/SimpleFinBot pip install -r requirements.txt -
Configure your bot token (choose one method above)
-
Run the bot:
python bot.py
-
In another terminal, start the API:
cd python/SimpleFinWebApi pip install -r requirements.txt python api.py
- ✅ Never commit real bot tokens to version control
- ✅ Use environment variables for production deployments
- ✅ The config.json file should be added to
.gitignore - ✅ Placeholder tokens will cause the bot to exit with an error message
- ✅ Both config file and environment variables are validated on startup
- Check that your bot token is valid
- Ensure all dependencies are installed:
pip install -r requirements.txt - Verify Python version is 3.8 or higher:
python --version
- Make sure the API is running on port 8000
- Check firewall settings
- Verify the database file is accessible
- Update the webapp_url in your configuration
- Ensure the WebApp HTML file is hosted and accessible
- Check that the API URL in the HTML file matches your API server