2 |
import { BanOptions, CommandInteraction, FileOptions, Guild, GuildBan, GuildMember, Message, MessageEmbed, MessageOptions, MessagePayload, TextChannel, User } from 'discord.js'; |
import { BanOptions, CommandInteraction, FileOptions, Guild, GuildBan, GuildMember, Message, MessageEmbed, MessageOptions, MessagePayload, TextChannel, User } from 'discord.js'; |
3 |
import ms from 'ms'; |
import ms from 'ms'; |
4 |
import DiscordClient from '../client/Client'; |
import DiscordClient from '../client/Client'; |
5 |
import Punishment from '../models/Punishment'; |
import Punishment, { IPunishment } from '../models/Punishment'; |
6 |
import { timeProcess, timeSince } from '../utils/util'; |
import { timeProcess, timeSince } from '../utils/util'; |
7 |
|
|
8 |
class Logger { |
class Logger { |
148 |
}, ban); |
}, ban); |
149 |
} |
} |
150 |
|
|
151 |
logSoftBan(banOptions: BanOptions, guild: Guild, user: User, model: Punishment) { |
logSoftBan(banOptions: BanOptions, guild: Guild, user: User, model: IPunishment) { |
152 |
this.channel(async (channel) => { |
this.channel(async (channel) => { |
153 |
let r = '*No reason provided*'; |
let r = '*No reason provided*'; |
154 |
|
|
179 |
iconURL: user.displayAvatarURL(), |
iconURL: user.displayAvatarURL(), |
180 |
}) |
}) |
181 |
.addField('Reason', r) |
.addField('Reason', r) |
182 |
.addField('Softbanned by', model.get().mod_tag) |
.addField('Softbanned by', model.mod_tag) |
183 |
.addField('User ID', user.id) |
.addField('User ID', user.id) |
184 |
.setFooter({ |
.setFooter({ |
185 |
text: "Softbanned", |
text: "Softbanned", |
192 |
}); |
}); |
193 |
} |
} |
194 |
|
|
195 |
logTempBan(banOptions: BanOptions, guild: Guild, user: User, model: Punishment) { |
logTempBan(banOptions: BanOptions, guild: Guild, user: User, model: IPunishment) { |
196 |
this.channel(async (channel) => { |
this.channel(async (channel) => { |
197 |
let r = '*No reason provided*'; |
let r = '*No reason provided*'; |
198 |
|
|
223 |
iconURL: user.displayAvatarURL(), |
iconURL: user.displayAvatarURL(), |
224 |
}) |
}) |
225 |
.addField('Reason', r) |
.addField('Reason', r) |
226 |
.addField('Banned by', model.get().mod_tag) |
.addField('Banned by', model.mod_tag) |
227 |
.addField('User ID', user.id) |
.addField('User ID', user.id) |
228 |
.addField('Duration', ms(model.get().meta?.time)) |
.addField('Duration', ms((model.meta as any).time)) |
229 |
.setFooter({ |
.setFooter({ |
230 |
text: "Temporarily banned", |
text: "Temporarily banned", |
231 |
}) |
}) |