Skip to content

A powerful and customizable Messenger automation bot, Easy to host in any hosting site

License

Notifications You must be signed in to change notification settings

sheikhtamimlover/ST-BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

66 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐐 ST-BOT - By Sheikh Tamim

ST-Bot Logo

A customized and powerful multi-purpose chatbot framework for Facebook Messenger

GitHub stars GitHub forks GitHub issues GitHub license Node.js Version Package Version Repository Size Last Commit Deploy on Render Visitors

Enhanced version of GoatBot V2 - Modified and maintained by Sheikh Tamim

Instagram GitHub


πŸ“– Table of Contents


πŸš€ Features

  • Modular Command System - Easy to add/remove commands
  • Premium System - Advanced premium user management
  • Fast and Scalable - Optimized bot core for high performance
  • Auto-restart and Watchdog - Self-healing capabilities
  • MongoDB/SQLite Support - Flexible database options
  • Dynamic Command Loader - Hot-reload commands without restart
  • Thread Approval System - Control bot access to groups
  • Anti-React System - Advanced message management
  • Real-time Dashboard - Live monitoring with WebSocket
  • Easy Deployment - One-click deployment on Replit & Render
  • Custom ST-FCA - Optimized Facebook Chat API
  • Bot Logging System - Comprehensive logging configuration
  • Prefix Management - Global and per-thread prefix control
  • Bio Update System - Automatic bio updates
  • Startup Notifications - Configurable startup messages

πŸ“ Command Structure

Command Structure

Every command in ST-BOT follows a standardized structure for consistency and ease of development:

Command Configuration

module.exports = {
  config: {
    name: "commandname",           // Command name (lowercase)
    aliases: ["alias1", "alias2"], // Alternative names
    version: "1.0.0",              // Command version
    author: "Your Name",           // Author name
    countDown: 5,                  // Cooldown in seconds
    role: 0,                       // 0: Everyone, 1: Group Admin, 2: Bot Admin
    premium: false,                // true: Premium only, false: Everyone
    usePrefix: true,               // true: Requires prefix, false: No prefix needed
    description: "Command description",
    category: "category name",
    guide: "{pn} <usage guide>"    // Usage instructions
  },

  langs: {
    en: {
      success: "Command executed successfully!",
      error: "An error occurred!"
    }
  },

  onStart: async function({ message, args, event, api, getLang }) {
    // Main command logic
    message.reply(getLang("success"));
  },

  onReply: async function({ message, Reply, event, api }) {
    // Handle user replies to bot messages
  },

  onChat: async function({ message, event, args }) {
    // Listen to all messages (without prefix)
  },

  onReaction: async function({ message, Reaction, event, api }) {
    // Handle reactions to bot messages
  }
};

Available Functions

  • message.reply(text) - Reply to user messages
  • message.send(text, threadID) - Send message to specific thread
  • message.unsend(messageID) - Unsend a message
  • message.reaction(emoji, messageID) - React to a message
  • message.pr(processingMessage, processingEmoji, successEmoji, errorEmoji) - Advanced processing message handler
    • processingMessage (optional): Message to display during processing (default: "⏳ Processing...")
    • processingEmoji (optional): Emoji to react with during processing (default: "⏳")
    • successEmoji (optional): Emoji to react with on success (default: "βœ…")
    • errorEmoji (optional): Emoji to react with on error (default: "❌")
    • Returns object with methods: edit(message), success(message), error(message)
  • api.sendMessage() - Direct API message sending
  • getLang(key, ...args) - Get localized text
  • usersData.get(userID) - Get user data
  • threadsData.get(threadID) - Get thread data

Example: Using message.pr() with custom emojis

// Default emojis
const pr = await message.pr("⏳ Processing your request...");
await pr.success("βœ… Done!");

// Custom emojis
const pr = await message.pr("πŸ”„ Working on it...", "πŸ”„", "πŸŽ‰", "πŸ’”");
await pr.success("πŸŽ‰ All done!");
await pr.error("πŸ’” Something went wrong!");

βš™οΈ Configuration Guide

Prefix Configuration

Global Prefix System

Configure prefix usage in config.json:

{
  "prefix": "!",
  "usePrefix": {
    "enable": true,                    // Global prefix requirement
    "adminUsePrefix": {
      "enable": true,                  // Admin prefix requirement
      "specificUids": []               // Specific users who need prefix
    }
  }
}

Options:

  • usePrefix.enable: true - All users must use prefix
  • usePrefix.enable: false - No prefix required globally
  • adminUsePrefix.enable: true - Admins must use prefix
  • adminUsePrefix.enable: false - Admins don't need prefix
  • specificUids: ["uid1", "uid2"] - Specific users affected by admin rules

Bot Account Configuration

Login credentials are set in config.json:

{
  "botAccount": {
    "email": "your_email@example.com",
    "password": "your_password",
    "userAgent": "Mozilla/5.0...",
    "autoUseWhenEmpty": true
  }
}

Note: If account.txt is empty, the bot will automatically use credentials from config.json to fetch cookies.


πŸ”§ Installation & Setup

πŸ–₯ Method 1: Local Setup

  1. Clone the repository:
git clone https://github.com/sheikhtamimlover/ST-BOT.git && cp -r ST-BOT/. . && rm -rf ST-BOT
  1. Install dependencies:
npm install
  1. Configure the bot:

    • Set your Admin UID in config.json β†’ adminBot array
    • Add your Facebook email/password in config.json β†’ botAccount
    • Or add cookies directly in account.txt (JSON format)
  2. Start the bot:

npm start

🌐 Method 2: Deploy on Render (Recommended)

Deploy on Render

  1. Click the "Deploy on Render" button above
  2. Configure your bot in config.json
  3. Click the Run button - Render handles everything automatically!

πŸ’Ž Premium System

Premium System

The bot includes a comprehensive premium user management system.

How Premium Works

For Users:

  • Request premium access: .premium request <message>
  • Premium users get exclusive command access

For Admins:

  • Add premium: .premium add <uid/@mention>
  • Remove premium: .premium remove <uid/@mention>
  • View premium users: .premium list
  • Check pending requests: .premium pending

Creating Premium Commands

module.exports = {
  config: {
    name: "premiumcommand",
    premium: true,  // Makes this command premium-only
    role: 0,
    // ... other config
  },

  onStart: async function({ message }) {
    message.reply("🌟 This is a premium feature!");
  }
};

πŸ”Œ ST-FCA (Custom Facebook API)

ST-BOT uses ST-FCA - an optimized, custom-built Facebook Chat API for better performance and reliability.

Installation

npm install stfca

GitHub Repository

πŸ”— https://github.com/sheikhtamimlover/ST-FCA.git

Features

  • βœ… Better stability and performance
  • βœ… Optimized for ST-BOT
  • βœ… Regular updates and bug fixes
  • βœ… Enhanced error handling
  • βœ… Improved cookie management

🎯 Advanced Features

Thread Approval System

Thread Approval 1

Thread Approval 2

Control which groups can use your bot:

{
  "threadApproval": {
    "enable": true,
    "adminNotificationThreads": ["thread_id"],
    "autoApproveExisting": true,
    "sendNotifications": true,
    "sendThreadMessage": true,
    "autoApprovedThreads": []
  }
}

Commands:

  • !threadapprove list - View all threads
  • !threadapprove approve <tid> - Approve a thread
  • !threadapprove unapprove <tid> - Unapprove a thread
  • !threadapprove pending - View pending threads

Bot Logging System

Bot Logging

Configure comprehensive logging:

{
  "botLogging": {
    "enable": true,
    "sendToThreads": true,
    "logThreadIds": ["thread_id"],
    "sendToAdmins": false,
    "silentOnDisabledThreads": true,
    "logBotAdded": false,
    "logBotKicked": true
  }
}

Anti-React System

Admin-only message management through reactions:

{
  "antiReact": {
    "enable": true,
    "reactByUnsend": {
      "enable": true,
      "emojis": ["πŸ‘"]
    },
    "reactByRemove": {
      "enable": true,
      "emoji": "⚠"
    },
    "onlyAdminBot": true
  }
}

Bio Update System

Bio Update 1

Bio Update 2

Automatically update bot bio:

{
  "bioUpdate": {
    "enable": true,
    "bioText": "ST Bot - Your custom bio here",
    "updateOnce": true
  }
}

Startup Notifications

Startup Notification

Send notifications when bot starts:

{
  "botStartupNotification": {
    "enable": true,
    "sendToThreads": {
      "enable": true,
      "threadIds": ["thread_id"]
    },
    "sendToAdmin": {
      "enable": false,
      "adminId": ""
    },
    "message": "πŸ€– Bot is now online!"
  }
}

πŸ“Š Dashboard

Dashboard

Access the powerful web dashboard with enhanced security:

{
  "dashBoard": {
    "enable": true,
    "port": 3021,
    "passwordProtection": {
      "enable": true,
      "password": "your_secure_password"
    }
  }
}

Features:

  • πŸ“Š Real-time statistics
  • πŸ‘₯ User management
  • πŸ’Ž Premium user control
  • πŸ“ Thread management
  • πŸ“ˆ Command analytics
  • πŸ”§ System monitoring

πŸ›οΈ ST Handlers Store

ST Handlers

Browse, install, and share commands, events, and APIs!

Usage

!sthandlers                    # Open main menu
!sthandlers <filename>         # Install from store
!sthandlers <name> <code>      # Upload command
!sthandlers -e <name> <code>   # Upload event
!sthandlers -p <filename>      # Upload from file path

Features

  • βœ… Browse commands by category
  • βœ… Install commands instantly
  • βœ… Share your own creations
  • βœ… Version control
  • βœ… Auto-load installed commands
  • βœ… Community-driven content

πŸ€– AI Command (STAI)

STAI Command

The most advanced AI command with code generation and bug fixing capabilities!

Features

  • 🧠 Generate commands and events
  • πŸ› Fix bugs in existing code
  • πŸ’‘ Code suggestions and improvements
  • πŸ”§ Auto-formatting and optimization
  • πŸ“ Documentation generation

Usage

!stai generate command <description>
!stai generate event <description>
!stai fix <command_name>
!stai improve <code>

πŸ“ž Support & Community

Need Help?

Regular Updates

  • βœ… Active development and maintenance
  • βœ… Regular feature additions
  • βœ… Bug fixes and improvements
  • βœ… Community-driven enhancements

Report Issues

Use the built-in report command:

!streport <describe your issue or feature request>

Your report will be sent directly to the developer!


πŸ“‹ Essential Commands

Command Description Access
!help View all commands All Users
!prefix View/change prefix Group Admin
!premium request Request premium All Users
!premium add Add premium user Bot Admin
!threadapprove Manage thread approval Bot Admin
!botlog Configure bot logging Bot Admin
!sthandlers Access command store All Users
!stai AI assistant All Users
!streport Report issues All Users
!update Update bot Bot Admin

πŸ”„ Regular Updates & Maintenance

This project receives regular updates with:

  • πŸ†• New Features
  • πŸ› Bug Fixes
  • πŸ”’ Security Patches
  • ⚑ Performance Optimizations
  • πŸ’Ž Premium Features

Stay updated by:

  • ⭐ Starring this repository
  • πŸ‘€ Watching for releases
  • πŸ“± Following on Instagram
  • πŸ’¬ Joining the support group

πŸ“„ License

This project is licensed under the MIT License. You are free to use, modify, and distribute this software, but please maintain the original credits.

Original GoatBot V2 by NTKhang
Enhanced & Maintained by Sheikh Tamim


❀️ Support the Project

If you find this project helpful:

  • ⭐ Star this repository
  • 🍴 Fork and contribute
  • πŸ“’ Share with others
  • πŸ’¬ Join our community
  • πŸ”— Follow on Instagram: @sheikh.tamim_lover

Happy Botting! πŸ€–βœ¨

Made with ❀️ by Sheikh Tamim

GitHub: sheikhtamimlover/ST-BOT
ST-FCA: sheikhtamimlover/ST-FCA

About

A powerful and customizable Messenger automation bot, Easy to host in any hosting site

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages