Add wiki and weather commands
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("kick")
|
||||
.setDescription("Kick misbehaving people")
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName('target')
|
||||
@@ -13,6 +14,7 @@ module.exports = {
|
||||
option
|
||||
.setName('reason')
|
||||
.setDescription('The reason of the kick')),
|
||||
category: 'Moderation',
|
||||
async execute(interaction) {
|
||||
const user = interaction.options.getUser('target');
|
||||
const reason = interaction.options.getString('reason') || 'No reason provided';
|
||||
@@ -20,6 +22,13 @@ module.exports = {
|
||||
try {
|
||||
const member = await interaction.guild.members.fetch(user.id);
|
||||
|
||||
if (!member.kickable) {
|
||||
return interaction.reply({
|
||||
content: 'I cannot kick that member. Check my role permissions and hierarchy.',
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
await member.kick(reason);
|
||||
|
||||
await interaction.reply(`Kicked ${user.tag} for: ${reason}`);
|
||||
|
||||
Reference in New Issue
Block a user