Replaced clang format with prettuier (sadly)
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits } from "discord.js"
|
||||
import {
|
||||
ContextMenuCommandBuilder,
|
||||
ApplicationCommandType,
|
||||
PermissionFlagsBits,
|
||||
} from "discord.js"
|
||||
import { ContextMenu } from "../interfaces"
|
||||
|
||||
export = {
|
||||
@@ -13,26 +17,43 @@ export = {
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames),
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const { targetId } = interaction
|
||||
const target = await interaction.guild!.members.fetch(targetId)
|
||||
|
||||
if (!target) {
|
||||
interaction.reply({ content: "That user does not exist.", ephemeral: true })
|
||||
interaction.reply({
|
||||
content: "That user does not exist.",
|
||||
ephemeral: true,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (target.id === interaction.user.id) {
|
||||
interaction.reply({ content: "You can't reset your own nickname.", ephemeral: true })
|
||||
interaction.reply({
|
||||
content: "You can't reset your own nickname.",
|
||||
ephemeral: true,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!target.manageable) {
|
||||
interaction.reply({ content: "I cannot reset that user's nickname.", ephemeral: true })
|
||||
interaction.reply({
|
||||
content: "I cannot reset that user's nickname.",
|
||||
ephemeral: true,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await target.setNickname(target.user.username, "Reset by " + interaction.user.username + "#" + interaction.user.discriminator)
|
||||
interaction.reply({ content: `Reset ${target.user.username}'s nickname.`, ephemeral: true })
|
||||
}
|
||||
} as ContextMenu
|
||||
await target.setNickname(
|
||||
target.user.username,
|
||||
"Reset by " +
|
||||
interaction.user.username +
|
||||
"#" +
|
||||
interaction.user.discriminator,
|
||||
)
|
||||
interaction.reply({
|
||||
content: `Reset ${target.user.username}'s nickname.`,
|
||||
ephemeral: true,
|
||||
})
|
||||
},
|
||||
} as ContextMenu
|
||||
|
||||
Reference in New Issue
Block a user