Updated dev deploy and unban command
This commit is contained in:
@@ -3,17 +3,31 @@ require("dotenv").config()
|
|||||||
const token = process.env.DEVTOKEN
|
const token = process.env.DEVTOKEN
|
||||||
const clientId = process.env.DEVID
|
const clientId = process.env.DEVID
|
||||||
const guildId = process.env.GUILDID
|
const guildId = process.env.GUILDID
|
||||||
|
const fs = require("fs")
|
||||||
const rest = new REST({ version: "10" }).setToken(token)
|
const rest = new REST({ version: "10" }).setToken(token)
|
||||||
|
|
||||||
const commands = []
|
const commands = []
|
||||||
const commandFiles = [
|
const commandFiles = fs.readdirSync("./src/commands/").filter(file => file.endsWith(".js"))
|
||||||
"../commands/config.js",
|
const contentMenuCommands = fs.readdirSync("./src/commands-contextmenu/").filter(file => file.endsWith(".js"))
|
||||||
"../commands/setup.js",
|
const commandsTesting = fs.readdirSync("./src/commands-testing/").filter(file => file.endsWith(".js"))
|
||||||
]
|
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`${file}`)
|
const command = require(`../src/commands/${file}`)
|
||||||
commands.push(command.data.toJSON())
|
if (command.dev) {
|
||||||
|
commands.push(command.data.toJSON())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const file of contentMenuCommands) {
|
||||||
|
const command = require(`../src/commands-contextmenu/${file}`)
|
||||||
|
if (command.dev) {
|
||||||
|
commands.push(command.data.toJSON())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const file of commandsTesting) {
|
||||||
|
const command = require(`../src/commands-testing/${file}`)
|
||||||
|
if (command.dev) {
|
||||||
|
commands.push(command.data.toJSON())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ module.exports = {
|
|||||||
name: "unban",
|
name: "unban",
|
||||||
description: "Unban a user from the server",
|
description: "Unban a user from the server",
|
||||||
type: "slash",
|
type: "slash",
|
||||||
dev: true,
|
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("unban")
|
.setName("unban")
|
||||||
@@ -22,7 +21,9 @@ module.exports = {
|
|||||||
.setName("reason")
|
.setName("reason")
|
||||||
.setDescription("The reason for unbanning the user")
|
.setDescription("The reason for unbanning the user")
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
),
|
)
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||||
|
.setDMPermission(false),
|
||||||
|
|
||||||
/** @param { import("discord.js").ChatInputCommandInteraction } interaction */
|
/** @param { import("discord.js").ChatInputCommandInteraction } interaction */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user