Files
revanced-bots/bots/discord/src/commands/moderation/cure.ts
PalmDevs 646ec8da87 feat(bots/discord): framework changes and new features
- Migrated to a new command framework which looks better and works better
- Fixed commands not being bundled correctly
- Added message (prefix) commands with argument validation
- Added a new CommandErrorType, for invalid arguments
- `/eval` is now a bit safer
- Corrected colors for the coinflip embed
- `/stop` now works even when the bot is not connected to the API
2024-07-30 21:15:36 +07:00

25 lines
854 B
TypeScript

import { ModerationCommand } from '$/classes/Command'
import { createSuccessEmbed } from '$/utils/discord/embeds'
import { cureNickname } from '$/utils/discord/moderation'
export default new ModerationCommand({
name: 'cure',
description: "Cure a member's nickname",
options: {
member: {
description: 'The member to cure',
required: true,
type: ModerationCommand.OptionType.User,
},
},
async execute(_, interaction, { member: user }) {
const guild = await interaction.client.guilds.fetch(interaction.guildId)
const member = await guild.members.fetch(user)
await cureNickname(member)
await interaction.reply({
embeds: [createSuccessEmbed(null, `Cured nickname for ${member.toString()}`)],
ephemeral: true,
})
},
})