Creating the Client
This page is intended to show you how to set up your main file/entry point.
const three = require("threecommands");
let bot = new three.Client({
prefix: "!",
token: "discord_token_here",
commandDir: "commands",
eventDir: "events"
}, {disableEveryone: true});
The three.Client()
constructor takes two arguments.
The first one is an object containing settings for your bot - the prefix, token, and directories. The commandDir
and eventDir
fields are the directories relative to this file where your commands and events are stored, relative to the current file.
The second argument are the options that are passed into the discord.js client directly. Here, we set it up to globally disable @everyone
and @here
mentions. The above example will work if you have a setup like this, assuming bot.js
is your entry point.
commands
- somecommands.js
- someothercommands.js
events
- ready.js
- messageDelete.js
bot.js