mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-30 22:51:01 +00:00
feat(bots/discord): support nickname decancering
This commit is contained in:
26
bots/discord/src/commands/moderation/cure.ts
Normal file
26
bots/discord/src/commands/moderation/cure.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { SlashCommandBuilder } from 'discord.js'
|
||||
|
||||
import type { Command } from '..'
|
||||
|
||||
import { config } from '$/context'
|
||||
import { cureNickname } from '$/utils/discord/moderation'
|
||||
|
||||
export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('cure')
|
||||
.setDescription("Cure a member's nickname")
|
||||
.addUserOption(option => option.setName('member').setRequired(true).setDescription('The member to cure'))
|
||||
.toJSON(),
|
||||
|
||||
memberRequirements: {
|
||||
roles: config.moderation?.roles ?? [],
|
||||
},
|
||||
|
||||
global: false,
|
||||
|
||||
async execute(_, interaction) {
|
||||
const user = interaction.options.getUser('user', true)
|
||||
const member = await interaction.guild!.members.fetch(user.id)
|
||||
await cureNickname(member)
|
||||
},
|
||||
} satisfies Command
|
||||
Reference in New Issue
Block a user