mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(bots/discord/commands): minor issues
This commit is contained in:
@@ -3,6 +3,7 @@ import { SlashCommandBuilder } from 'discord.js'
|
||||
import type { Command } from '..'
|
||||
|
||||
import { config } from '$/context'
|
||||
import { createSuccessEmbed } from '$/utils/discord/embeds'
|
||||
import { cureNickname } from '$/utils/discord/moderation'
|
||||
|
||||
export default {
|
||||
@@ -19,8 +20,12 @@ export default {
|
||||
global: false,
|
||||
|
||||
async execute(_, interaction) {
|
||||
const user = interaction.options.getUser('user', true)
|
||||
const user = interaction.options.getUser('member', true)
|
||||
const member = await interaction.guild!.members.fetch(user.id)
|
||||
await cureNickname(member)
|
||||
await interaction.reply({
|
||||
embeds: [createSuccessEmbed(null, `Cured nickname for ${member.toString()}`)],
|
||||
ephemeral: true,
|
||||
})
|
||||
},
|
||||
} satisfies Command
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
'The provided member is not in the server or does not exist.',
|
||||
)
|
||||
|
||||
if (member.manageable)
|
||||
if (!member.manageable)
|
||||
throw new CommandError(CommandErrorType.Generic, 'This user cannot be managed by the bot.')
|
||||
|
||||
if (moderator.roles.highest.comparePositionTo(member.roles.highest) <= 0 && !userIsOwner)
|
||||
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
'The provided member is not in the server or does not exist.',
|
||||
)
|
||||
|
||||
if (member.manageable)
|
||||
if (!member.manageable)
|
||||
throw new CommandError(CommandErrorType.Generic, 'This user cannot be managed by the bot.')
|
||||
|
||||
if (action === 'apply') {
|
||||
|
||||
Reference in New Issue
Block a user