JSPM

gcommands

1.0.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q72766F
  • License ISC

Open-source slah command handler

Package Exports

  • gcommands

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gcommands) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

G Commands


Instalaltion

npm install gcommands

How use?
index.js

const { GCommands } = require("gcommands");
const Discord = require("discord.js");

const client = new Discord.Client();

client.on("ready", () => {
    new GCommands(client, {
        cmdDir: "commands",
        ignoreBots: true,
        errorMessage: "Error :("
    })
})

client.login("token")

ping.js

module.exports = {
    name: "ping",
    description: "Check bot ping",
    run: async(client, cmd) => {
        client.api.interactions(cmd.id, cmd.token).callback.post({
            data: {
                type: 4,
                data: {
                    content: "My ping is " + Math.round(client.ws.ping) + "ms"
                }
            }
        })
    }
};