Updated dev deploy and unban command

This commit is contained in:
2023-11-30 15:58:04 +01:00
parent c135c46101
commit 44d24024d8
2 changed files with 23 additions and 8 deletions

View File

@@ -3,18 +3,32 @@ 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}`)
if (command.dev) {
commands.push(command.data.toJSON()) 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 () => {
try { try {

View File

@@ -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 */