This project is a Google Apps Script that interacts with Telegram to manage expenses. It allows you to add new expenses, categorize them, and receive feedback in a humorous or strict manner. Additionally, it can send charts and summaries of your expenses to Telegram.
1. Code.gs
This file contains the main logic for handling requests and interacting with the Google Sheet.
This file contains functions to interact with the Telegram API, including sending messages and photos, setting webhooks, and fetching updates.
This file contains the function to interact with the Gemini API to classify and comment on expenses.
- Create a new Google Apps Script project.
- Add the provided files (
Code.gs,telegramBot.gs,ChatGemini.gs) to your project. - Replace the placeholders in the constants (
TOKEN,CHAT_ID,DEPLOYED_URL,API_KEY) with your actual values. - Deploy the script as a web app to receive webhook requests from Telegram.
- Add expenses: Send a message to your Telegram bot with the expense details.
- Get total expenses: Send the command
/sumto your Telegram bot. - Get expense charts: Send the command
/chartto your Telegram bot.
This project is licensed under the MIT License.