Scuffy "force-verify" command.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
const { ApplicationCommandType, ApplicationCommandOptionType, EmbedBuilder } = require('discord.js');
|
||||
const cfg = require('../../config/config.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'admin-verify',
|
||||
description: 'Administrative commands for verification.',
|
||||
type: ApplicationCommandType.ChatInput,
|
||||
options: [
|
||||
{
|
||||
name: 'force-verify',
|
||||
description: 'Force verify a user.',
|
||||
type: ApplicationCommandOptionType.Subcommand,
|
||||
options: [
|
||||
{
|
||||
name: 'user',
|
||||
description: 'The user to verify.',
|
||||
type: ApplicationCommandOptionType.User,
|
||||
required: true
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
default_member_permissions: ["Administrator"],
|
||||
run: async (client, interaction) => {
|
||||
const guildId = interaction.guild.id;
|
||||
|
||||
await interaction.deferReply({ ephemeral: true});
|
||||
const user = interaction.options.getUser('user');
|
||||
const member = await interaction.guild.members.fetch(user.id);
|
||||
if (!member) return interaction.editReply({ content: 'User not found.' });
|
||||
if (member.roles.cache.has(cfg.guilds[guildId].roleToAdd)) return interaction.editReply({ content: 'User is already verified.' });
|
||||
await member.roles.add(cfg.guilds[guildId].roleToAdd);
|
||||
await member.roles.remove(cfg.guilds[guildId].firstRole);
|
||||
return interaction.editReply({ content: `User has been verified.` });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user