Main File
There are 3 types of languages that CDHandler takes!
// File Name - index.js
const colour = require("cdcolours");
const { Client } = require("discord.js");
const { CDHandler } = require("cdhandler");
// Declearing the client
const client = new Client()
client.on('ready', async () => {
new CDHandler(client, {
commandsDir: "commands", // String - commands directory
eventsDir: "events", // String - events directory
featuresDir: "features", // String - features directory
prefix: "!",
category: "Misc", // String - Default category for commands
pingReply: true, // Boolean - If you want the bot to reply with it's prefix when it gets pinged
devs: [], // Array - Bot Developer ID's for devOnly commands.
defaults: true, // Boolean - active default commands
mongo: "Your MongoPath", // String - Connects to MongoDB
warnings: true, // Boolean - active CDHandler warnings
})
console.log(
colour("[READY]", { textColour: "green" }) +
` Successfully logged in as ${client.user.tag}`,
);
})
// You can get your token by making an application at discord.dev/applications.
client.login("BOT_TOKEN");
// File Name - index.js
import colour from "cdcolours";
import { Client } from "discord.js";
import { CDHandler } from "cdhandler";
import { config as dotenv } from "dotenv";
dotenv();
const client = new Client();
client.on("ready", () => {
new CDHandler(client, {
commandsDir: "commands", // String - commands directory
eventsDir: "events", // String - events directory
featuresDir: "features", // String - features directory
prefix: "!",
category: "Misc", // String - Default category for commands
pingReply: true, // Boolean - If you want the bot to reply with it's prefix when it gets pinged
devs: [], // Array - Bot Developer ID's for devOnly commands.
defaults: true, // Boolean - active default commands
mongo: "Your MongoPath", // String - Connects to MongoDB
warnings: true, // Boolean - active CDHandler warnings
});
console.log(
colour("[READY]", { textColour: "green" }) +
` Successfully logged in as ${client.user!.tag}`,
);
});
// You can get your token by making an application at discord.dev/applications.
client.login("BOT_TOKEN");
# File Name - index.js
colour = require "cdcolours";
{ Client } = require "discord.js";
{ CDHandler } = require "cdhandler";
client = new Client();
client.on "ready", =>
new CDHandler client,
commandsDir: "commands" # String - commands directory
eventsDir: "events" # String - events directory
featuresDir: "features" # String - features directory
prefix: "!"
category: "Misc" # String - Default category for commands
pingReply: true # Boolean - If you want the bot to reply with it's prefix when it gets pinged
devs: [] # Array - Bot Developer ID's for devOnly commands.
defaults: true # Boolean - active default commands
mongo: "Your MongoPath" # String - Connects to MongoDB
warnings: true # Boolean - active CDHandler warnings
console.log colour("[READY]", textColour: "green") +
"Successfully logged in as #{client.user.tag}"
# You can get your token by making an application at discord.dev/applications.
client.login "BOT_TOKEN";
Last updated
Was this helpful?