Skip to content

Commit

Permalink
feat(command): add moderation category
Browse files Browse the repository at this point in the history
* Command added...
- `/ban` - Ban users
- `/kick` - Kick users
  • Loading branch information
tinarskii committed Nov 10, 2022
1 parent aa4d302 commit 833040a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/commands/mod/ban.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Discord, Slash, SlashOption } from "discordx";
import { Category } from "@discordx/utilities";
import { ApplicationCommandOptionType, CommandInteraction, GuildMember, User } from "discord.js";

@Discord()
@Category("Moderation")
export class KickCommand {
@Slash({ name: "kick", description: "Kick a user" })
async kick(
@SlashOption({
name: "user",
description: "Select a user to kick",
required: true,
type: ApplicationCommandOptionType.User
})
@SlashOption({
name: "reason",
description: "Reason for kicking the user",
required: false,
type: ApplicationCommandOptionType.String
})
user: GuildMember,
reason: string = "Not specified",
interaction: CommandInteraction
): Promise<void> {
await user.kick(reason);
await interaction.reply(`Successfully kicked <@${user.id}>\nReason: \`${reason}\``);
}
}
Empty file added src/commands/mod/kick.ts
Empty file.

0 comments on commit 833040a

Please sign in to comment.