Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 3.25 KB

README.md

File metadata and controls

91 lines (60 loc) · 3.25 KB

Firefly Telegram Bot

Fireflies are free, so beautiful. (Les lucioles sont libres, donc belles.)
― Charles de Leusse, Les Contes de la nuit

This is a simple Telegram bot with interface to Firefly III to process and store simple transactions (e.g. withdraw, deposit, transfer).

sample-transaction

This bot uses natural language processing (NLP).

The public bot can be accessed in telegram @FinanceFlyBot. I advised to create your own bot as the DB for this is not encrypted and for testing purposes only. The bot is hosted in Azure App Services free tier.

Docker 🐋

Docker images can be found in this link:

Deployment

The bot can be easily deployed through containerization (e.g. docker).
To run the docker image:

docker run \
    -e TG_BOT_TOKEN=<tg-token> \
    -e TG_MASTER_ID=<chat-id or user-id> \
    -e FF_BASE_PATH=<firefly-url> \
    -e FF_PAT=<firefly-token> \
    -e APP_SHARED_STORAGE_PATH=/var/lib/ff-bot-db \
    -e WIT_ACCESS_TOKEN=<wit-access-token> \
    -v $PWD:/var/lib/ff-bot-db \
     0x61c88647/firefly-tg-bot-rs:latest

The wit.ai Bot

The bot can be found here. Use your facebook login to access the bot, its open and can be accessed freely. All private data will not be stored in the utterance list. You can export it to create your own bot.

Environment Variables

This are the relevant environment variables needed to be set.

TG_BOT_TOKEN - The telegram bot token which can be found in BotFather after creating a new bot.
TG_MASTER_ID - The responsible person on where to report error (can be a group, channel, or user).
FF_BASE_PATH - The firefly III instance that this bot will connect to.
FF_PAT - This is your firefly III personal access token.
APP_SHARED_STORAGE_PATH - The path where the local account storage will be stored (e.g. /var/lib/ff-bot-db).
WIT_ACCESS_TOKEN - This is your wit.ai access token.

What's in the roadmap?

  • Create state machine to reduce code duplication.
  • Make bot accept more words.
  • Get info about latest 10 transaction created.
  • Do reconcilation and support tags and categories.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Related Projects

References