1.2.5 • Published 12 months ago

guilded-handler v1.2.5

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Guilded Command Handler

This package is inspired by discord command handlers. Supports: Guilded.js

Installs

Note: This package doesn't use Guilded.js 's built-in command class. Instead it uses easy-to-understand simple logic. We will surely support using the command class in the future because it has more features. Note: This package is for beginners. Advanced users should use the command class and custom code for their command handler.


index.js

const { Client } = require("guilded.js");
const client = new Client({ token: process.env.token });

client.on("ready", () => console.log(`${client.user.raw.name} is Online`));

require('guilded-handler')(client,{
    path_to_dir:"./commands",
    prefix:"A!" /*Or (client,message) => { Do something }*/,statuses:{
        interval:10000 /* must be over 10000 */,
        arr:[
                {
                content:"Hello!",
                emoteId:0000000
                },...,...
            ]
        }
    })

client.login();

Command file structure

module.exports = {
    name: 'hello', //command name (required)
    aliases: ["hel"], //optional
    disabled: false, //optional (default=false)
    run: (client,message,args) => { //(required)
        // run code
    }
}

Features

  • Lightweight
  • Fast loading
  • Loaded commands map
// To access it
<GuildedJSBotClient>.commands
  • Refreshes commands without restarting the bot
// To refresh
<GuildedJSBotClient>.cmd.load()
// Experimental
  • Can load a whole directory tree. You can freely categorize the commands by many folders as you want.
  • Prefix option can be a function so you can implement custom prefixes or you say, "Guild specific prefix or User specific prefix"
  • Supports command aliases
  • Supports command disabling
  • Supports guilded bot statuses (new)
  • And more...

What's new

  • Fixed Commands Map
  • Added Bot Status Config

What's being made

  • Event commands handling
  • Command specific cooldown (user/guild specific)
  • GuildedJS 's command class support

Guilded.js docs Guilded API Support