Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rasedi Telegram Bot SDK 🤖💳

A production-ready Telegram Bot SDK for seamlessly integrating the Rasedi Payment Gateway natively within Telegram. This application provides an end-to-end interactive dashboard for users to generate, share, check, and cancel Rasedi payment checkout links dynamically inside Telegram chats.


🌟 Features

  • Multi-Language (i18n) Engine: Fully localized prompt interfaces natively supporting English, Arabic, and Kurdish.
  • Interactive Configuration Dashboard: Users can visually manage their API PrivateKey, SecretKey, mandatory URL routing, and Gateway Toggles directly inside the bot interface.
  • Deep-Link Sharing Integration: Generates robust Telegram deep links (t.me/share/url) alongside successful payment tickets allowing users to instantly forward checkout URLs to groups and channels.
  • Ed25519 Cryptographic Security: Fully replicates the Rasedi Backend authentication flow on Node.js using @noble/ed25519, safely and securely signing outbound payload requests.
  • Docker & AWS ECS Ready: Pre-configured architecture for scalable deployments on AWS native infrastructure.

🚀 Getting Started

Prerequisites

Installation

  1. Clone the Repository

    git clone git@github.com:MirotechTeam/rasedi-telegram-bot.git
    cd rasedi-telegram-bot
  2. Install Dependencies

    npm install
  3. Configure Environment Variables Duplicate .env.example into a local .env and assign your bot token.

    cp .env.example .env

    .env File:

    TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
    WEBHOOK_BASE_URL="https://yourwebsite.com" # Fallback webhook URL for Rasedi Callbacks

🛠 Usage

Run Locally (Development)

By running the bot in dev mode, hot-reloading ensures fast prototyping:

npm run dev

Run Production Build

npm run build
npm start

Once running, send /start to your bot on Telegram to initialize the interactive payment onboarding!

🐳 Docker & AWS ECS Deployment

For cloud environments, we provide an optimized, multi-stage Alpine Dockerfile.

  1. Build the container image:

    docker build -t rasedi-telegram-bot .
  2. Run securely: Ensure you pass the required environment variables during runtime.

    docker run -d -e TELEGRAM_BOT_TOKEN="token" rasedi-telegram-bot

Note on State Storage: By default, user credentials and localization settings are securely written to users_db.json. When deploying continuously to stateless environments like AWS ECS (Fargate), you are advised to mount the JSON path onto an AWS EFS volume or map the storage driver to a PostgreSQL/DynamoDB cluster.

⚙️ How It Works (Development Flow)

The application utilizes Telegraf to handle complex user conversation steps (State Machines).

  • /src/example/locales.ts: Modifies or overrides bot translation data mappings.
  • /src/rasedi/client.ts: Core API transport mechanism handling serialization across gateways.
  • /src/bot.ts: Presentation wrappers dynamically rendering Telegram Inline Keyboards and deep links.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages