Skip to content

Latest commit

 

History

259 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayScribe Logo

PayScribe

Track your Telegram group payments right in the chat.

What is PayScribe?

PayScribe is a Telegram bot designed to help you track your group expenses in any Telegram group chat. It does not require any signup, any registration, or any external tools. Just add the bot into your group chat, and you're ready to go!

Table of Contents

  1. Features
  2. Getting Started as a User
    a. Bot Commands
    b. User Guide
  3. For Developers
    a. Setup
    b. Codebase

Features

  • Tracking group payment records
  • Automatic simplification of debts within groups
  • Complete viewability and editability of all payment records
  • 3 different modes of splitting the costs
    • By equal amounts
    • By exact amounts
    • By proportionate amounts
  • No setup required, everything runs right within the chat

Getting Started as a User

PayScribe can be found at @PayScribeBot.

To get started with using the bot, add the bot into any group chat of your choice! You can then check out the available bot commands with /help, or as listed below.

Bot Commands

/start — "Start" the bot.

/help — Show all commands and how to use the bot.

/addpayment — Add a new payment entry for the group.

/payback — Add a new entry paying back other members in the group.

/viewpayments — View all payment records for the group.

/editpayment — Edit a payment record that was previously added.

/deletepayment — Delete a payment record that was previously added.

/balances — View the current balances for the group.

/spendings — View the total spendings for the group.

/settings - View and edit bot settings for the group.

/cancel — Cancel an ongoing action.

User Guide

For more details on how to use the bot, the various commands and configurations, do check out the User Guide!

The guide also contains more examples, tips, and advice on maximizing your use of PayScribe.

For Developers

If you are interested, you are welcome to fork this repo and deploy your own bot.

This bot was written in Rust using Teloxide, and uses a Redis database.

The API used for currency conversion rates is from fawazahmed0.

Below, I will go through the steps for setting up the environment, and an overview of the codebase.

Setup

  1. Clone the repo.

  2. Ensure that you have Redis, Rust, and Cargo installed.

  3. Add environment variables to a new file .env. You will need two variables:

  4. Start your Redis server, and run the following command in the project root directory:

cargo run

Codebase

The codebase consists of mainly the Bot module, which has the following submodules:

  • Handler: Deals with user-facing/UX logic, mainly the back-and-forth conversational logic for the bot. The Handler is invoked by the Dispatcher, and calls the Processor's functions.
  • Redis: Contains all database-related CRUD operations. Exposes a set of functions for the Processor to call.

Apart from these, the other main components of the bot are:

  • Dispatcher: Manages the conversation branches of the Telegram bot.
  • Processor: Deals with the main backend facing logic for the bot, serves as intermediary between front-facing Handler and Redis.
  • Optimizer: Separate crate for handling debt simplification logic, invoked by the Processor.
  • Currency: Separate crate for handling currency-related logic, used by the Processor and Handler.

About

A Telegram bot for tracking payments among members in a group

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages