6 |
import MessageEmbed from '../../client/MessageEmbed'; |
import MessageEmbed from '../../client/MessageEmbed'; |
7 |
import getUser from '../../utils/getUser'; |
import getUser from '../../utils/getUser'; |
8 |
import History from '../../automod/History'; |
import History from '../../automod/History'; |
9 |
|
import Punishment from '../../models/Punishment'; |
10 |
|
import PunishmentType from '../../types/PunishmentType'; |
11 |
|
|
12 |
export default class BanCommand extends BaseCommand { |
export default class BanCommand extends BaseCommand { |
13 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
106 |
|
|
107 |
try { |
try { |
108 |
await msg.guild?.bans.create(user, banOptions); |
await msg.guild?.bans.create(user, banOptions); |
109 |
|
|
110 |
|
await Punishment.create({ |
111 |
|
type: PunishmentType.BAN, |
112 |
|
user_id: user.id, |
113 |
|
guild_id: msg.guild!.id, |
114 |
|
mod_id: msg.member!.user.id, |
115 |
|
mod_tag: (msg.member!.user as User).tag, |
116 |
|
reason: banOptions.reason ?? undefined |
117 |
|
}); |
118 |
|
|
119 |
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); |
120 |
} |
} |
121 |
catch (e) { |
catch (e) { |