2.0.4 • Published 1 year ago

@shadowgarden/djs-framebot v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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!')
  }
}

⭐ the project if you like it!

Join our discord

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

1.1.1

2 years ago

1.1.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago