commit 0444dc2ee89e55adf759e680d3eb9afb7b32b788
parent eaea49de85976bac37c20b96f57aa4693be7fd49
Author: night0721 <[email protected]>
Date: Fri, 25 Mar 2022 03:36:31 +0800
alright it is finally working
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/events/interactionCreate.js b/events/interactionCreate.js
@@ -83,11 +83,7 @@ client.on("interactionCreate", async interaction => {
if (cmd.Level) {
if (!data.Guild.Level) return;
}
- if (cmd.name == "nsfw" && !data.Guild?.NSFW) {
- interaction.followUp({
- content: "NSFW commands have been disabled in this server",
- });
- }
+
if (!interaction.guild.me.permissions.has(cmd.BotPerms || [])) {
return interaction.followUp({
content: `You can't use this command. I need to have ${cmd.BotPerms} permission to use this command.`,
@@ -115,6 +111,12 @@ client.on("interactionCreate", async interaction => {
}
}
const random = utils.rndint(3, 6);
+ if (cmd.name == "nsfw" && !data.Guild?.NSFW) {
+ interaction.followUp({
+ content: "NSFW commands have been disabled in this server",
+ });
+ return;
+ }
if (cmd.timeout) {
const current_time = Date.now();
const cooldown_amount = cmd.timeout;