2.0.4 • Published 3 months ago

@shadowgarden/djs-framebot v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months 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

3 months ago

2.0.3

3 months ago

2.0.2

3 months ago

1.1.1

10 months ago

1.1.2

10 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.1.0

11 months ago

1.0.9

11 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago