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 gcommandsHow 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"
}
}
})
}
};