1 |
import { BanOptions, CommandInteraction, GuildMember, Interaction, Message, User } from 'discord.js'; |
import { Permissions, BanOptions, CommandInteraction, GuildMember, Interaction, Message, User } from 'discord.js'; |
2 |
import BaseCommand from '../../utils/structures/BaseCommand'; |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
import DiscordClient from '../../client/Client'; |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
import CommandOptions from '../../types/CommandOptions'; |
13 |
export default class BanCommand extends BaseCommand { |
export default class BanCommand extends BaseCommand { |
14 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
15 |
supportsContextMenu: boolean = true; |
supportsContextMenu: boolean = true; |
16 |
|
permissions = [Permissions.FLAGS.BAN_MEMBERS]; |
17 |
|
|
18 |
constructor() { |
constructor() { |
19 |
super('ban', 'moderation', ['Ban']); |
super('ban', 'moderation', ['Ban']); |
139 |
guild_id: msg.guild!.id, |
guild_id: msg.guild!.id, |
140 |
mod_id: msg.member!.user.id, |
mod_id: msg.member!.user.id, |
141 |
mod_tag: (msg.member!.user as User).tag, |
mod_tag: (msg.member!.user as User).tag, |
142 |
reason: banOptions.reason ?? undefined |
reason: banOptions.reason ?? undefined, |
143 |
|
createdAt: new Date() |
144 |
}); |
}); |
145 |
|
|
146 |
await History.create(user.id, msg.guild!, 'ban', msg.member!.user.id, typeof banOptions.reason === 'undefined' ? null : banOptions.reason, async (data: any) => undefined); |
await History.create(user.id, msg.guild!, 'ban', msg.member!.user.id, typeof banOptions.reason === 'undefined' ? null : banOptions.reason, async (data: any) => undefined); |