@shadowgarden/djs-framebot
v2.0.4
Published
a framework for djs
Downloads
4
Readme
DJS Framework
A framework for your bot with discord.js@v14
Contents
How to use it?
<your bot name>/
├─ src/
│ ├─ slashCommands/
│ ├─ textCommands/
│ ├─ events/
│ │ ├─ client/
│ │ ├─ guild/
│ ├─ config.js
│ ├─ index.js
├─ node_modules/
├─ package.json
Create your workspace like this
Config.js
module.exports = {
bot: {
token:
"TOKEN-GOES-HERE",
intents: ["Guilds"] // the intents to load
},
events: {
dir: "bot/events", // events directory
subDirs: ["client"], // sub-directories of events
dirs: true, // whether or not if you have sub-directories
showLogs: false
},
slashCommand: {
dir: "bot/slashCommands", // slash command directory
parentCommands: [{
dir: "lol", // sub-directory if you want
name: "lol",
description: "lola"
}],
showLogs: false
},
textCommand: {
dir: "bot/textCommands", // text command directory
folders: ["lol"],
showLogs: false
}
}
Index.js
const {
Client
} = require(`@shadowgarden/djs-framebot`)
const config = require("./config")
const client = new Client(config)
client.start()
Slash Command Structure
module.exports = {
name: "ping", //name of the command
description: "ping bot", //description of the command
options: [{
name: "user",
type: "User",
description: "user..",
required: false
}],
cooldown: {
enable: true,
time: 5000
},
clientPermissions: [],
memberPermissions: [],
adminOnly: false,
ownerOnly: false,
run: async(client, int) => {
int.follow({
content: "lol"
})
}
}
Text Command Structure
module.exports = {
name: "ping",
description: "ping",
cooldown: {
enable: true,
time: 5000
},
clientPermissions: [],
memberPermissions: [],
adminOnly: false,
ownerOnly: false,
run: async(client, message, args) => {
message.channel.send('pong!')
}
}