8 |
import History from '../../automod/History'; |
import History from '../../automod/History'; |
9 |
import getMember from '../../utils/getMember'; |
import getMember from '../../utils/getMember'; |
10 |
import ms from 'ms'; |
import ms from 'ms'; |
11 |
|
import Punishment from '../../models/Punishment'; |
12 |
|
import PunishmentType from '../../types/PunishmentType'; |
13 |
|
|
14 |
export default class UnbanCommand extends BaseCommand { |
export default class UnbanCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
75 |
|
|
76 |
try { |
try { |
77 |
await msg.guild?.bans.remove(user); |
await msg.guild?.bans.remove(user); |
78 |
|
|
79 |
|
await Punishment.create({ |
80 |
|
type: PunishmentType.UNBAN, |
81 |
|
user_id: user.id, |
82 |
|
guild_id: msg.guild!.id, |
83 |
|
mod_id: msg.member!.user.id, |
84 |
|
mod_tag: (msg.member!.user as User).tag, |
85 |
|
}); |
86 |
|
|
87 |
await History.create(user.id, msg.guild!, 'unban', (msg.member!.user as User).id, null); |
await History.create(user.id, msg.guild!, 'unban', (msg.member!.user as User).id, null); |
88 |
} |
} |
89 |
catch (e) { |
catch (e) { |