Skip to content
/ CassidyRedux Public template

CassidyRedux is a revamped version of CassidyBoT with enhanced features and improved performance created by lianecagara.

License

Notifications You must be signed in to change notification settings

lianecagara/CassidyRedux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CassidyRedux

CassidyRedux is a revamped version of CassidyBoT with enhanced features and improved performance created by Liane Cagara (lianecagara in github). This project aims to provide a robust and flexible bot framework with a variety of commands and functionalities.

Table of Contents

Introduction

CassidyRedux is designed to be a powerful and extensible bot framework that allows developers to create and manage a wide range of commands and functionalities. It leverages modern JavaScript features and provides a structured approach to command creation and management.

Features

  • Command Management: Easily create, register, and manage commands.
  • API Integration: Integrate with various APIs to extend the bot's capabilities.
  • Customizable: Highly customizable with support for plugins and middleware.
  • Performance: Optimized for performance with parallel execution of plugins.
  • Extensible: Support for external plugins and modules.
  • User Management: Manage users, permissions, and roles.
  • Inventory System: Advanced inventory management with support for indexing and limits.
  • Idle Games: Built-in support for idle games.
  • CORS Support: Cross-Origin Resource Sharing (CORS) support for web integrations.
  • Dynamic WS Protocol: Dynamic WebSocket protocol for real-time communication.
  • Enhanced UI: Improved user interface with support for themes and custom fonts.

Changelog

All notable changes to this project will be documented in this file.

πŸš€ Features

  • (modules) ReduxCMDHome and UniRedux
  • (api) Added ReduxCMDHome demo to api cmd
  • (ts) Ended typescript support but ts file will still work but no type checking.
  • (font) FontMarkups for adding font without manually typing
  • (home) Added aliases feature and reworked changename to identity
  • (casscli) Added a cli
  • (web) Auto adjust rows
  • (start) Shop
  • (inv) Inv limit is starting to become larger, inv also now support index as key
  • (cmd) Command icons
  • (lotto) Rework
  • (collectibles) Added global collectible registry
  • (cmd) RR
  • (ccli) More Unix Commands
  • (idle) More idle games
  • (web) Added CORS
  • (api) Bitbros api
  • (type) Some non edge case type for database
  • (cmd) Goattranslate
  • (cmds) Entry Type
  • (cmd) More commands
  • (exp) Initial CassEXP and cache methods on db
  • (exp) Exp on ui every response
  • (event) Mention to UID
  • (exp) New Formula
  • (exp) Tiles now give exp
  • (shop) Tiles theme
  • (exp) Shop now give exp
  • (type) Cheque types
  • (cmd) First ever multiplayer game
  • (exp) Lock command by exp
  • (idle) Harvest gets upgrade
  • Mine

πŸ› Bug Fixes

  • (issues) Fixed common issues
  • (cmd) Fixed CassCLI Files not saving
  • (trade) Fixed inventory toss
  • (api) Quiz and Wordgame
  • (nerf) Nerfed new idle games
  • (player) Fixed UI

πŸ’Ό Other

  • Dynamic WS Protocol
  • Tiles themes
  • Pet feed give exp
  • (factory) Demo

🚜 Refactor

  • (json) Reorganized settings.json
  • (reduxCMDHome) Stable
  • (commands) Used Unregistered for default name, and reworked money.js
  • (money) Standardized emoji and pipe, and refactored money.js to use reduxHome
  • (cmd) Standardizing start as help list
  • (cmds) Utilizing latest API for commands
  • (commandNotFound) Improve error handling for unknown commands
  • (cmd) Reworked cheque cmd
  • (cmds) Refactor all cmds
  • (inv) Reworked Inventory Command
  • (inv) No more 8 limit
  • (shop) Now Optimized and consistent
  • (lotto) Range from 75 to 45
  • (category) New Categories in Start Menu
  • (json) Encounter enemy data
  • (middleware) Command linkTo
  • Font & ui
  • (idle) Now uses redux home

⚑ Performance

  • (loaders) Improve plugin loading speed with parallel execution

βš™οΈ Miscellaneous Tasks

  • (config) Removed test command and added a working start command

Getting Started

Prerequisites

  • Node.js
  • npm (Node Package Manager)
  • MongoDB

Installation

  1. Clone the repository:

    git clone https://github.com/lianecagara/CassidyRedux.git
    cd CassidyRedux
  2. Install the dependencies:

    npm install

Configuration

  1. Create a .env file in the root directory and add the following:

    MONGO_URI="replace with the mongodb uri"

Deployment

  1. To deploy the bot, simply run:

    npm start

Creating Commands

Command Structure

A command in CassidyRedux is typically defined in a JavaScript file with the following structure:

export const meta = {
    name: "example",
    otherNames: ["ex", "examples"],
    author: "Author's Name",
    version: '1.0.0',
    description: "This is an example command used in demonstration.",
    usage: "{prefix}{name}",
    category: "Examples",
    noPrefix: "both",
    permissions: [0, 1, 2],
    botAdmin: false,
    waitingTime: 10,
    ext_plugins: {
        output: "^1.0.0"
    },
    whiteList: [
        "id1",
        "id2"
    ],
    args: [
        {
            degree: 0,
            fallback: null,
            response: "You cannot use this argument",
            search: "disallowedArg",
            required: false,
        }
    ],
    supported: "^1.0.0"
};

export async function entry({ input, output }) {
    output.reply('Hello, this is an example command!');
}

Meta Options

The meta object contains important configuration information for the command. Here are the available options:

  • name: The primary name of the command.
  • otherNames: An array of alternative names for the command.
  • author: The author of the command.
  • version: The version of the command.
  • description: A brief description of what the command does.
  • usage: Instructions on how to use the command.
  • category: The category under which the command falls.
  • noPrefix: Specifies whether the command can be used without a prefix. Possible values are "both", true, or false.
  • permissions: An array specifying the required permissions to use the command. (0: non-admin, 1: gc admin, 2: bot admin)
  • botAdmin: A boolean indicating whether the command requires bot admin permissions.
  • waitingTime: The cooldown time (in seconds) before the command can be used again.
  • ext_plugins: An object specifying external plugins required by the command.
  • whiteList: An array of user IDs that are allowed to use the command.
  • args: An array of argument configurations. Each argument can have the following properties:
    • degree: The degree of the argument.
    • fallback: The fallback value if the argument is not provided.
    • response: The response message if the argument is not allowed.
    • search: The search term for the argument.
    • required: A boolean indicating whether the argument is required.
  • supported: The supported version of the command.

Context Variables

When defining the entry function for your command, you have access to several context variables:

  • input: The input object containing information about the command invocation.
    • input.text: The text of the command.
    • input.senderID: The ID of the user who sent the command.
    • input.threadID: The ID of the thread where the command was sent.
    • input.arguments: An array of arguments passed to the command.
    • input.isAdmin: A boolean indicating whether the user is an admin.
    • input.replier: The replier object if the command is a reply.
  • output: The output object used to send responses back to the user.
    • output.reply(text): Sends a reply to the user.
    • output.error(err): Sends an error message to the user.
    • output.send(text, id): Sends a message to a specific user or thread.
    • output.add(user, thread): Adds a user to a thread.
    • output.kick(user, thread): Kicks a user from a thread.
    • output.unsend(mid): Unsend a message by its ID.
    • output.reaction(emoji, mid): Reacts to a message with an emoji.
  • event: The event object containing details about the event that triggered the command.
  • api: The API object for interacting with the platform (e.g., sending messages).
  • commandName: The name of the command being executed.
  • args: An array of arguments passed to the command.

Example Command

Here is a more detailed example of a command that uses various meta options and context variables:

export const meta = {
    name: "greet",
    otherNames: ["hello", "hi"],
    author: "Author's Name",
    version: '1.0.0',
    description: "Sends a greeting message.",
    usage: "{prefix}greet [name]",
    category: "General",
    noPrefix: "both",
    permissions: [0],
    botAdmin: false,
    waitingTime: 5,
    ext_plugins: {
        output: "^1.0.0"
    },
    whiteList: null,
    args: [
        {
            degree: 0,
            fallback: "User",
            response: "You need to provide a name.",
            search: "name",
            required: false,
        }
    ],
    supported: "^1.0.0"
};

export async function entry({ input, output, args }) {
    const name = args[0] || "User";
    output.reply(`Hello, ${name}!`);
}

Core Files

Cassidy.js

This file contains the core logic and configuration for CassidyRedux. It includes methods for loading commands, plugins, and managing the bot's state.

api.js

This file defines the api command, which provides access to Cassidy's Developer API. It includes various handlers for different API functionalities.

loadCommand.js

This file contains the logic for loading and registering commands in CassidyRedux.

loadPlugins.js

This file contains the logic for loading and managing plugins in CassidyRedux.

extends.js

This file extends the core functionality of CassidyRedux with additional features and utilities.

License

This project is licensed under a special LICENSE, see the LICENSE file for details.

About

CassidyRedux is a revamped version of CassidyBoT with enhanced features and improved performance created by lianecagara.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published