This Telegram bot facilitates creating Firefly III transactions as well as provides some capabilities to manage other Firefly's entities like Accounts, Categories, Reports, etc.
First you'll have to generate a Telegram Bot token through BotFather. Once you generate the token, keep it safe.
docker run \
--rm --it --init --name firefly-bot \
--volume `pwd`/sessions:/home/node/app/sessions \
--env BOT_TOKEN=<your-bot-token> \
cyxou/firefly-iii-telegram-bot:latest
You may also provide additional environment variables via the .env file. For this rename the example.env to .env and update it with your values. Then you can pass it to docker like so:
docker run \
--rm --it --init --name firefly-bot \
--volume `pwd`/sessions:/home/node/app/sessions \
--env-file .env \
cyxou/firefly-iii-telegram-bot:latest
For this you need to have NodeJS installed.
- Clone the repository
- Install dependencies by running
npm install
- Run
export BOT_TOKEN=<your-bot-token>
- Run
npm start
If you'll have certificate errors when trying to connect to Firefly III instance,
stop the bot, do export NODE_TLS_REJECT_UNAUTHORIZED=0
in your shell and start the
bot.
To build docker images you would need to install additional tools and packages.
- Docker
- Earthly
- QEMU for building multi platform docker images.
On linux, QEMU needs to be installed manually. On Ubuntu, this can be achieved by running:
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker stop earthly-buildkitd || true
More info here.
- Add English translations and make it a default language
- Add transactions improvements (create transfers and deposits)
- Edit transactions (no date change thus far)
- Localization based on Firefly user's preferences
- Accounts management
- List transactions
- Add math equations when creating transactions
- Allow selecting of Liabilities accounts in transactions
- Configure CI/CD so that it builds and pushes docker images on merges to master
- Reports
- Proper error handling
- Tests
- Add JSON database for persistance (used @grammyjs/storage-file)
- Add date picker when editing transaction (adopt https://github.com/gianlucaparadise/telegraf-calendar-telegram)
- Migrate from home grown Mapper to Grammy's Menu plugin
This thing is used to generate typescript-axios client code for the Firefly III API published here
There is an issue with Configuration model: the generated code has its own
Configuration
thing that corresponds to axios configuration. Firefly also has
Configuration
endpoint and corresponding models which upon code generation produce
compiler errors due to ambiguity and to naming collision.
In order to solve this issue, I've just ignored the Firefly Configuration API
generation by adding the api/configuration-api.ts file to
.openapi-generator-ignore file and customizing the ./src/lib/firefly/api.ts
file, which also had to be referenced in the .openapi-generator-ignore.
There is a corresponding task for it in the package.json file: codegen
.
Hence the command is npm run codegen
. Running this command should not introduce
any git changes unless you want to rollback or update the API specification URL
which is hard-coded in codegen
npm task.
- No support for multiple transaction splits. It is assumed that transactions consist of only one transaction split.
- Looks like for a brand new user account the built-in "(cash)" account is created upon first creation of a transaction via the Firefly UI. Until that built-in "(cash)" account is created, the default Expense account will be an account without a name which is weird.
Join the 🔗 Q&A Telegram group if you have any questions, feedback or ideas to implement.