Intellisense
Intellisense is a powerful feature that helps you with properties and such!
Examples
// File Name - ping.js
const { MessageEmbed } = require("discord.js");
const { Command } = require("cdhandler");
module.exports = new Command({
name: "ping",
aliases: ["Pong"],
description: "Replies with Pong!",
cooldown: "5s",
cooldownMessage: "Wait {REMAINING} more to execute this command again!",
//usage: "", it's not needed on this command
//example: "", it's not needed on this command
minArgs: 0,
maxArgs: 0,
argsMessage:
"Incorrect Arguments! There are no arguments required for this command!",
dev: true,
devMessage: "You must be a developer to run this command!",
nsfw: true,
nsfwMessage: "You cannot run this command in SFW channels!",
permissions: ["KICK_MEMBERS"],
permissionsMessage:
"You must have the 'Kick Members' permission to run this command!",
botPermissions: ["EMBED_LINKS"],
botPermissionsMessage:
"I cannot run this command without the 'Embed Links' permission!",
category: "Misc",
locked: true,
lockedMessage: "This command is locked at the moment!",
hidden: true,
hidden2: true,
servers: ["769710808435261490"],
serversMessage: "Use this command in CDHandler support server!",
run: ({ message, args, client, handler }) => {
const embed = new MessageEmbed()
.setColor("#00DCFF")
.setTitle("Pong!");
message.channel.send(embed);
handler.cooldown(message, "5s"); // this creates a cooldown
},
});
// File Name - ping.ts
import { MessageEmbed } from "discord.js";
import { Command, CommandOptions } from "cdhandler";
export default new Command({
name: "ping",
aliases: ["Pong"],
description: "Replies with Pong!",
cooldown: "5s",
cooldownMessage: "Wait {REMAINING} more to execute this command again!",
//usage: "", it's not needed on this command
//example: "", it's not needed on this command
minArgs: 0,
maxArgs: 0,
argsMessage:
"Incorrect Arguments! There are no arguments required for this command!",
dev: true,
devMessage: "You must be a developer to run this command!",
nsfw: true,
nsfwMessage: "You cannot run this command in SFW channels!",
permissions: ["KICK_MEMBERS"],
permissionsMessage:
"You must have the 'Kick Members' permission to run this command!",
botPermissions: ["EMBED_LINKS"],
botPermissionsMessage:
"I cannot run this command without the 'Embed Links' permission!",
category: "Misc",
locked: true,
lockedMessage: "This command is locked at the moment!",
hidden: true,
hidden2: true,
servers: ["769710808435261490"],
serversMessage: "Use this command in CDHandler support server!",
run: ({ message, args, client, handler }: any) => {
const embed = new MessageEmbed()
.setColor("#00DCFF")
.setTitle("Pong!");
message.channel.send(embed);
handler.cooldown(message, "5s"); // this creates a cooldown
},
} as CommandOptions);
Last updated
Was this helpful?