Skip to content

splitllmbill/splitllm-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SplitLLM Telegram Bot

A standalone Telegram bot for the SplitLLM application, enforcing Service-to-Service authentication.

Features

  • Personal Expenses: Send text like "Lunch 20" to add personal expenses.
  • Group Expenses:
    • Use /g_expense <group_name> <amount> <description>
    • Or upload a receipt and select a group.
  • View Data: Check /dues, /stats, /groups, and /friends.

Setup

  1. Create Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Environment Variables: Copy .env.example to .env and fill in:

    • TELEGRAM_BOT_TOKEN: From @BotFather.
    • BOT_SERVICE_SECRET: A secure random string shared with the Backend.
    • BACKEND_URL: URL of your running backend.

Authentication Flow

This bot does not handle user login directly.

  1. User Linking:
    • User logs into the SplitLLM Web/App.
    • User requests to "Link Telegram".
    • Backend generates a unique linking code.
    • User enters this code in the Web/App.
    • Backend validates and stores the telegram_id against the user's account.
  2. Bot Requests:
    • The Bot sends X-Telegram-User-ID and X-Bot-Secret on every request.
    • The Backend verifies the Secret and uses the ID to identify the user.

Running

python bot.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors