Skip to content

Budget Bot#

Information#

A simple and Easy to use Budget bot that integrates Google Sheet to telegram bot.

Bot functions includes:

  • Daily summary text
  • Check Google Calendar
  • Summary of Finances
  • Add Transaction to google sheets
  • See last 3 transactions
  • To-Do list
  • Get latest news (Singapore Straits Time and mothership)
  • Check bus arrival timing with details of bus
  • Get Causeway Link LTA Traffic Camera
  • Get rain update
  • Get weather Forecast

Credits:

  • Hao Han : For coding the telegram bot Hao Han

  • Jovin : For Designing the Budget Google Sheets Jovin

Setup#

1. Prerequisite#

1.1. Copied both Control Panel and Budget sheet#

File Link

1.2. Create the Bot using Telegram's Bot father @BotFather .#

BotFather Link

Alt text

1.3. Get LTA API Access Key#

  • This is for Bus and LTA Camera Command

  • You can request for the key here: LTA API Request

  • Usage put Student Project then write anything for description

  • Fill in the rest and agree to terms of use then submit

  • Wait for a few minutes and you shall recieve the email

  • You may recieve 2 email, one from DataMall and one from extol.

  • The DataMall API Account key is what you need



2. Configure the script#

2.1. Get the Jovin's Annual Budget Sheet ID#

Alt text

  • The URL consist of the Sheet ID

  • To get the sheet id is the one after d/ to the one before /edit......

  • For example the link is:

        https://docs.google.com/spreadsheets/d/1waaaaaabbbbbccccddddeeeeffffgggg/edit#gid=141334129
    
  • The ID will be :

        1waaaaaabbbbbccccddddeeeeffffgggg
    

Up to now you should have:#

  1. Bot Token from BotFather

  2. LTA API Key

  3. The Budget Sheet ID


2.2. Fill the Setup Sheet:#

  1. Bot Token

  2. LTA Key

  3. Sheet ID

  4. Bus stop code Bus stop code can set the one you frequently use. For example mine is 77281

Alt text


2.3. Open the Script for the bot#

Alt text


2.4. New Deployemnt#

  1. Top Right Blue Deploy button
  2. New Deployment"

Alt text


2.5. New Web app#

Alt text


2.6. Deployment config#

  • New Description can be anything
  • Just copy the rest and press Deploy

Alt text


2.7. Authorize Access#

Alt text


2.8. Go to Budget-Bot (Unsafe)#

Alt text


2.9. Allow#

Alt text


2.10. Copy the Web app URL#

Alt text


2.11. "Paste the Web app URL to the WebAppUrl line#

  • In this case it is line 5

  • Then re deploy again (manage Deployment)."

Alt text

2.12. Redeployment#

Alt text


2.13. Press the green button First Run in sheet : Setup#

Alt text



3. Other Setup#

3.1. Start your telegram bot and you should recieved an Access Denied#

  • Those numbers are your Telegram Authenication ID

Alt text


3.2. Copy those number and insert it to Line 1 in the Apps Script#

  • Remember to redeploy after inserting your ID!!!

  • Refer to step 2.12. on redeployment

Alt text


3.3. Set subscription tracker trigger#

  • On Left side sellect Triggers

  • At this page press Add Triger"

Alt text


3.4. Set the Trigger#

  • Select function : reset_subscription_tracker

  • !! Ensure the time is after 3am Singapore time

Alt text

  • Repeat step 3.4 for :

    • daily_update

    • goodnight

    • repeated_transaction

    • The timing for these 2 function can be to your preference :

      • daily_update : morning 7am to 8am (Recomended)

      • goodnight : during evening 8pm to 9pm" (Recomended)

      • repeated_transaction : month timer, 1st day of the month after 3am to 4am (Recomended)

Done!!!#

FYI#

  • You may give other people access by inserting their ID into the Setup sheet.

    • Cell A3 to A11
  • To Deactivate the bot, click the red button Remove