def report_handler(update: Update, context: CallbackContext): """ Get full report of expenses """ Expense.select(fn.SUM(Expense.amount)).scalar() context.bot.send_message(chat_id=update.effective_chat.id, text="")
def total_handler(update: Update, context: CallbackContext): """ Return the total spent so far """ total = Expense.select(fn.SUM(Expense.amount)).scalar() context.bot.send_message(chat_id=update.effective_chat.id, text=f"Total amount : {total}")