Fixed formatting on all command files
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
User
|
||||
} from "discord.js"
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention, User } from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
@@ -37,20 +32,17 @@ export = {
|
||||
await interaction.deferReply()
|
||||
|
||||
const userid = interaction.options.getString("user")!
|
||||
const reason =
|
||||
interaction.options.getString("reason") || "No reason provided"
|
||||
const reason = interaction.options.getString("reason") || "No reason provided"
|
||||
const mod = interaction.user
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
let user: User
|
||||
|
||||
if (userid === "none") {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "You haven't specified a user to unban",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "You haven't specified a user to unban",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -59,12 +51,10 @@ export = {
|
||||
user = await interaction.client.users.fetch(userid)
|
||||
} catch (error) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "The user you specified is not valid",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
description: "The user you specified is not valid",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -72,54 +62,44 @@ export = {
|
||||
await interaction.guild!.members.unban(user.id, reason)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined
|
||||
},
|
||||
title: "Member Unbanned",
|
||||
description: `
|
||||
**User:** ${userMention(user!.id)}
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
**Reason:** ${reason}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + user!.id,
|
||||
icon_url: user.avatarURL() || undefined
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
embeds: [{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined
|
||||
},
|
||||
title: "Member Unbanned",
|
||||
description: `
|
||||
**User:** ${userMention(user!.id)}
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
**Reason:** ${reason}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + user!.id,
|
||||
icon_url: user.avatarURL() || undefined
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: "User unbanned",
|
||||
description:
|
||||
"The user " +
|
||||
user!.username +
|
||||
" has been unbanned.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`\n" +
|
||||
"**Moderator:** " +
|
||||
userMention(mod.id),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user!.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
embeds: [{
|
||||
title: "User unbanned",
|
||||
description: "The user " + user!.username + " has been unbanned.\n" +
|
||||
"**Reason:** `" + reason + "`\n" +
|
||||
"**Moderator:** " + userMention(mod.id),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user!.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
}
|
||||
} as Command
|
||||
|
||||
Reference in New Issue
Block a user