crord

a Discord Framework with Command Handler & Automatic Arguments

Usage no npm install needed!

<script type="module">
  import crord from 'https://cdn.skypack.dev/crord';
</script>

README

Crord

Download License

a Discord Framework with Command Handler & Automatic Arguments Creator's Discord Tag: croxy#2361

Examples

Creating bot.js

const crord = require("crord");
const client = new crord({
    token: "YOUR TOKEN",
    prefix: "!",
    commandFolder: "commands",
    developers: ["YOUR ID", "ANOTHER DEVELOPER'S ID", "AND ANOTHER ONE", ...]
  //If you want to use arguments with await messages, add this option:
  argAwaitMessages: true
})

//if you want to add commands with crord module's self handler, u must write this function:
client.loadCommands();

//and you can add events in a folder.
client.loadEvents("events_folder_name")

client.on("active", async() => {
    client.user.setActivity(`${client.settings.prefix}help`)
})

client.start();

Command Handler (No Args)

const Command = require("crord/base/Command")

class CommandName extends Command {
  constructor (client) {
    super(client, {
      name: "name",
      description: "description",
      usage: "usage",
      aliases: ["aliases1", "aliases2", ...]
    });
  }

  async run (client, message, args) {

    message.channel.send("hello world")
    
    
  }

}

module.exports = CommandName;

Command Handler (With Args)

const Command = require("crord/base/Command")

class CommandName extends Command {
  constructor (client) {
    super(client, {
      name: "name",
      description: "description",
      usage: "usage",
      aliases: ["aliases1", "aliases2", ...]
      args: [
        {
            key: "member", //you can write everything on here.
            type: "member", //all types: member, string, number, channel, role
            msg: "Please give me a member." //you can write everything on here.
        }
      ]
    });
  }

  async run (client, message, args) {

    message.channel.send(`This member's nickname: **${args.member.user.username}**`)
    
    
  }

}

module.exports = CommandName;

You must add commands with category file. An example; "bot_folder/commands/category_name/command.js"