Skip to content

robertoyamanaka/mango-bot

Repository files navigation

AI Community Rewards + Telegram Mini App

A Telegram Mini App (TMA) that rewards active community participation through AI-powered analysis and blockchain rewards, powered by Dynamic wallet integration.

Overview

This project combines Telegram's Mini App functionality with AI-driven community engagement tracking and blockchain rewards. It:

  • Analyzes and scores user interactions in Telegram communities
  • Distributes ERC20 token rewards across Starknet and EVM chains
  • Provides seamless wallet integration through Dynamic
  • Ensures secure data handling with Phala Network and Nillion

Quick Start

  1. Create a Telegram Bot:

    • Use BotFather to create your bot
    • Save the Bot TOKEN for later use
  2. Setup the project:

    git clone <repository-url>
    cp .env.sample .env

    Update .env with:

    • Your Dynamic environment ID (NEXT_PUBLIC_DYNAMIC_ENV_ID)
    • Bot TOKEN from Telegram
    • Website URL as LOGIN_URL
  3. Deploy the website:

  4. Configure Telegram Mini App:

  5. Run the Telegram bot:

    # Install ts-node if you haven't already
    npm -g i ts-node
    
    # Run the bot
    ts-node scripts/bot.ts
  6. Test the integration:

    • Go to your Telegram Bot
    • Type /start

Technical Architecture

The system leverages several key technologies:

  • AI Processing & Security

    • Phala Network for Remote Attestation
    • Red Pill API for conversation analysis
  • Data Privacy

    • Nillion for encrypted storage
    • Secure API endpoints for data access
  • Blockchain Integration

    • Dynamic for embedded wallets
    • Multi-chain support (Starknet & EVM)

Environment Variables

BOT_TOKEN=your_telegram_bot_token LOGIN_URL=your_deployed_website_url

Resources

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.