2.0.0 • Published 7 years ago

discord-commandis v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

About

Discord CommandIs a framework for Discord.js that enables you to easily create a with many commands. This framework is inspired by the legendary YouTuber and bot creator, itsPrime. This package may or may not be a joke ;) but it still does its job and has a reasonable level of functionality, simplicity and options. It also uses my console styling module, console-styles (shoutout to 1Comp)

Examples

const { Client } = require("discord-commandis");

const client = new Client({
    token: "your token",
    prefix: "!",
    gameText: "commandIs :D",
    readyText: "Ready!",
    selfbot: false,
    logTypes: {
        awesome: ["bgCyan", "black", "bold"]
    },
    clientOptions: {
        fetchAllMembers: true
    },
    storagePath: "./storage.json",
    storageSpacing: "\t"
});

// Make a new command
client.commandIs("say", (message, args) => {
	message.channel.send(args.join(" "));
});

// Command with aliases
client.commandIs(["dice", "roll"], (message, args) => {
    const roll = Math.floor(Math.random() * 6) + 1;
    message.channel.send(`You rolled **${roll}**`);
});

// External files still work somewhat
const command = require("./insult.js");
client.commandIs([command.name, ...command.aliases], command.execute);

client.log("Wow cool colours in the console", client.logTypes.awesome);

// start the bot after everything is setup, resolves when 'ready'
client.start()
    .then(() => {
        client.log("Hola amigos", client.logTypes.success);
    })
    .catch(client.log);

// read, write, merge and clone json storage, parsing and stringifying is done internally
client.storage.read()
    .then(data => {
        data.commandIs = "great";
        return client.storage.write(data)
    })
    .then(() => {
        return client.storage.merge({
            fancyObject: true,
            combinesTheTwo: true,
            likeObjectAssign: true
        });
    })
    .then(() => {
        return client.storage.clone("./cloned.json");
    })
    .then(newStorage => {
        newStorqage.write({ xD: true });
    });
    .catch(client.log);

Support/Issues

This framework is something that I'm likely not going to maintain well, if you are looking for a real framework check out YAMDBF, Akairo and Commando. If you really do need some help (as I'm not writing docs for this) then find me on discord, I'll be in a lot of discord.js related servers (except for the official one FeelsBannedMan :/ ) such as idiots guide, discord api and yamdbf.