Skip to content

SlashBot is an easy-to-use Telegram Bot that assists you in recording your daily expenses on a local system without any hassle

License

Notifications You must be signed in to change notification settings

secheaper/slashbot

 
 

Repository files navigation

💸 SlashBot


Expense tracking made easy!


MIT license GitHub GitHub contributors DOI Platform codecov Actions Status github workflow Discord Lines of code Version GitHub issues GitHub closed issues


Demo Video

https://youtu.be/NBihyIU13pw

About SlashBot

SlashBot is an easy-to-use Telegram Bot that assists you in recording your daily expenses on a local system without any hassle.
With simple commands, this bot allows you to:

  • Add/Record a new spending
  • Show the sum of your expenditure for the current day/month
  • Display your spending history
  • Clear/Erase all your records
  • Edit/Change any spending details if you wish to
  • Download your expenditure history in the CSV format
  • Visualize your spendings in the form of graphs/pie chart using the /chart option
  • Email the history CSV file to yourself
  • See the total daily/monthly expenditure in different currencies

Check out the bot here: https://t.me/ncsuBot


Sample demos are shown below. They are run on a local machine.


⭐ Whats New

Release Version 1.2.1

  • See your total daily/monthly expenditure in differet currencies using the /displayDifferentCurrency command
  • Download your spendings history CSV file using the /download command
  • Email the monthly spendings history to yourself using the /sendEmail command
  • User can now get a message when the monthly budget is exhausted.
  • Details for testing requirements added in README.md

Release Version 1.2.0

  • Visualize your spendings in the form of graphs
  • The User can now see his expenses across various categories in the form of graphs along with pie charts.
  • Just go on adding multiple spendings using /add and type /chart to see the spendings in the form of graphs.
  • More Badges added in Repository

🚀 Installation Guide

💻For developers

  1. Install Python, atleast Python3

  2. Clone this repository to your local system at a suitable directory/location of your choice

  3. Start a terminal session, and navigate to the directory where the repo has been cloned

  4. Run the following command to install the required dependencies:

  pip install -r requirements.txt
  1. Download and install the Telegram desktop application for your system from the following site: https://desktop.telegram.org/

  2. Once you login to your Telegram account, search for "BotFather" in Telegram. Click on "Start" --> enter the following command:

  /newbot
  1. Follow the instructions on screen and choose a name for your bot. Post this, select a username for your bot that ends with "bot" (as per the instructions on your Telegram screen)

  2. BotFather will now confirm the creation of your bot and provide a TOKEN to access the HTTP API - copy this token for future use.

  3. Search for "Edit the system environment variables" on your local computer. Click on Environment Variables and create a new System Variable called "API_TOKEN" and paste the token copied in step 8.

  4. In the Telegram app, search for your newly created bot by entering the username and open the same. Once this is done, go back to the terminal session. Make sure you export the PYTHONPATH variable to the main project folder

python src/bot.py
  1. A successful run will generate a message on your terminal that says "TeleBot: Started polling."
  2. Post this, navigate to your bot on Telegram, enter the "/start" or "/menu" command, and you are all set to track your expenses!

For more info on deployment(Heroku), check out the doc here

💻For testing with Pytest

  1. Some modules in testing require CHAT_ID environment variable to be set.
  2. This is the specific ID that is maintained for your chat with the Bot.
  3. While running the bot.py , get this id from line 72 and set it in your system environment variables.
  4. This should ensure effective running of all tests.

💁 Sample Demos

Budget

I want to increase/decrease my monthly budget.

  1. Enter the /budget command
  2. Enter the new budget amount (must be greater than 0)

Add

I just spent money and want to mark it as a transaction!

  1. Enter the /add command
  2. Click on the date of the transaction
  3. Click on the category to add
  4. Type in the amount spent

Delete

Oh no! I entered a transaction but want to delete it!

  1. Enter the /delete command
  2. Based on how many records you want to delete..
    1. Per day: enter the day to delete
    2. Per month: enter the month to delete
    3. All: enter All
  3. The records will be display. Enter YES to confirm, or NO to cancel

Edit

Oh no! I entered a transaction but entered the wrong category!

  1. Enter the /edit command
  2. Specify the date, category, and value of the transaction
  3. Specify what part of the transaction to edit (either date, category, or value)
  4. Enter in a new value

Adding transactions from CSV and displaying chart

I want to add transactions from a CSV my bank gave me, and visalize my spendings

  1. Drag the .csv file into the telegram chat, and press send
  2. For each transaction, classify the category
    1. The application will remember these mappings
  3. Enter the /chart command

Download History

I want a CSV file of all my transactions.

  1. Make sure you have a transaction history.
  2. Enter the /download command.
  3. A CSV file will be sent with your history.

See total Expenditure in different currencies

I want to convert my total daily or monthly expenditure in a different currency.

  1. Enter the /displayDifferentCurrency command
  2. Choose from the category of day or month
  3. Next, Choose your currency from the options
  4. You will get the converted price in that currency

Visualization in the form of graphs

I want to see my spendings in the form of graphs

  1. Make sure you have a transaction history.
  2. Enter the /chart command.
  3. You will see multiple visualizations for your spending

SendEmail

I want to send myself an email for the monthly expenditure

  1. Make sure you have a transaction history.
  2. Enter the /sendEmail command.
  3. Type the intended email address
  4. You will get an email with the history file as attachment

❔ Documentation

Thorough documentation of all methods and classes can be found at Github Pages

🚧 Road Map

Our ideas for new features that can be implemented to make this project better can be seen in our RoadMap project board. Road Map

❤️ Acknowledgements

We would like to thank Dr. Timothy Menzies for helping us understand the process of building a good Software Engineering project. We would also like to thank the teaching assistants Xiao Ling, Andre Lustosa, Kewen Peng, Weichen Shi for their support throughout the project.

📄 License

This project is licensed under the terms of the MIT license. Please check License for more details.

✨ Contributors


Shubham Mankar

Pratik Devnani


Moksh Jain


Rahil Sarvaiya


Anushi Keswani

📲 Support

For any support, email us at [email protected]/ [email protected]

About

SlashBot is an easy-to-use Telegram Bot that assists you in recording your daily expenses on a local system without any hassle

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%