Skip to content

A powerful Facebook Messenger bot with commands for media downloading, uptime tracking, and more. Built for ease of use and customization.

License

Notifications You must be signed in to change notification settings

1dev-hridoy/Kenji-Cloud

Repository files navigation

banner

Kenji Cloud Bot - Bot Chat Messenger

A powerful Facebook Messenger bot with commands for media downloading, uptime tracking, and more. Built for ease of use and customization.

Overview

Kenji Cloud is an open-source bot designed to enhance Messenger group chats with features like video downloads (Facebook, Instagram, TikTok, YouTube), uptime monitoring, and custom goodbye messages. It’s lightweight, extensible, and perfect for community management.

Technologies

Tech Stack

  • Node.js: Runtime for the bot.
  • JavaScript: Core scripting language.
  • HTML/CSS: For web dashboard.
  • Axios: HTTP requests for APIs.
  • Express: Web server framework.
  • MongoDB: Data persistence.
  • Git: Version control.

Installation

Prerequisites

  • Node.js (v18+)
  • npm (comes with Node.js)
  • Git
  • A Facebook account for app state
  • Internet connection

Steps

  1. Clone the Repository:

    git clone https://github.com/1dev-hridoy/Kenji-Cloud.git
    cd Kenji-Cloud
    
  2. Install Dependencies:

    npm install
    
  3. Set Up Environment:

    • Edit config/config.json with:

      {
        "botName": "Kenji Cloud",
        "prefix": "!",
        "botpicture": "https://i.ibb.co/Xxmdjjfm/Flux-Dev-cinematic-keyframe13-anime-keyframe12-Animestyle-port-2.jpg",
        "ownerName": "Hridoy",
        "ownerUID": "61575746590997",
        "adminUIDs": [
          "61575746590997",
          "another uid"
        ]
      }
    • Use the c3c utility extension to export a fresh Facebook app state and save it as appstate.json.

  4. Create Directories:

    mkdir config logger/logs database database/backup temp modules/commands/nayan
    
  5. Run the Bot:

    node .
    
    • Enter 2FA if prompted.
    • Access the dashboard at http://localhost:3000.
  6. Test Commands:

    • Try !dl https://www.facebook.com/share/v/1J2zkAmJke/ or !uptime.

Samples

How to Make a Command

Create a file in modules/commands/ (e.g., hello.js):

module.exports = {
  config: {
    name: 'hello',
    version: '1.0',
    author: 'Hridoy',
    countDown: 5,
    prefix: true,
    adminOnly: false,
    aliases: ['hlw', 'hi'],
    description: 'replay hello message',
    category: 'box chat',
    guide: {
      en: '   {pn}hello]'
    },

module.exports.run = async ({ api, event }) => {
    api.sendMessage("Hello! 👋", event.threadID);
};
  • Use !hello to trigger it.

How to Make an Admin-Only Command

Add adminOnly: true, to restrict to admins (0 for all, 1 for admins):

module.exports = {
  config: {
    name: 'hello',
    version: '1.0',
    author: 'Hridoy',
    countDown: 5,
    prefix: true,
    adminOnly: true,
    aliases: ['hlw', 'hi'],
    description: 'replay hello message',
    category: 'box chat',
    guide: {
      en: '   {pn}hello]'
    },
  },

module.exports.run = async ({ api, event }) => {
    api.sendMessage("This is an admin command!", event.threadID);
};
  • Only admins can use !admincmd.

How to Make a No-Prefix Command

Set prefix: false to trigger without a prefix:

module.exports = {
  config: {
    name: '`noprefix',
    version: '1.0',
    author: 'Hridoy',
    countDown: 5,
    prefix: false,
    adminOnly: false,
    aliases: ['hlw', 'hi'],
    description: 'replay hello message',
    category: 'box chat',
    guide: {
      en: '   {pn}hello]'
    },

module.exports.run = async ({ api, event }) => {
    if (event.body.toLowerCase() === "noprefix") {
        api.sendMessage("No prefix needed! 😄", event.threadID);
    }
};
  • Typing noprefix triggers it.

How to Make a Group-Admin-Only Command

Add groupAdminOnly: true to restrict to group admins:

module.exports.config = {
    name: "groupadmin",
    version: "1.0",
    author: "Hridoy",
    countDown: 5,
    prefix: true,
    groupAdminOnly: true,
    description: "Group admin-only command.",
    category: "admin"
};

module.exports.run = async ({ api, event }) => {
    api.sendMessage("Only group admins can see this!", event.threadID);
};
  • Only group admins can use !groupadmin.

Support & Contact

Feel free to report issues, suggest features, or seek help!

Contributing

Fork the repo, make changes, and submit a pull request. All contributions are welcome!

License

MIT License

About

A powerful Facebook Messenger bot with commands for media downloading, uptime tracking, and more. Built for ease of use and customization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published