Fix a bunch of linter errors
diff --git a/src/utils/log.ts b/src/utils/log.ts
index f9f751e..6baa0a5 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -7,18 +7,17 @@
const wait = promisify(setTimeout);
-
export class Logger {
renderUser(user: Discord.User | string) {
if (typeof user === "string") return `${user} [<@${user}>]`;
return `${user.username} [<@${user.id}>]`;
}
renderTime(t: number) {
- t = Math.floor(t /= 1000);
+ t = Math.floor((t /= 1000));
return `<t:${t}:D> at <t:${t}:T>`;
}
renderDelta(t: number) {
- t = Math.floor(t /= 1000);
+ t = Math.floor((t /= 1000));
return `<t:${t}:R> (<t:${t}:D> at <t:${t}:T>)`;
}
renderNumberDelta(num1: number, num2: number) {
@@ -35,19 +34,23 @@
return `${role.name} [<@&${role.id}>]`;
}
renderEmoji(emoji: Discord.GuildEmoji) {
- return `<${emoji.animated ? "a" : ""}:${emoji.name}:${emoji.id}> [\`:${emoji.name}:\`]`;
+ return `<${emoji.animated ? "a" : ""}:${emoji.name}:${emoji.id}> [\`:${
+ emoji.name
+ }:\`]`;
}
public readonly NucleusColors = {
- red: 0xF27878,
- yellow: 0xF2D478,
- green: 0x68D49E
-
+ red: 0xf27878,
+ yellow: 0xf2d478,
+ green: 0x68d49e
};
- async getAuditLog(guild: Discord.Guild, event: Discord.GuildAuditLogsResolvable): Promise<Discord.GuildAuditLogsEntry[]>{
+ async getAuditLog(
+ guild: Discord.Guild,
+ event: Discord.GuildAuditLogsResolvable
+ ): Promise<Discord.GuildAuditLogsEntry[]> {
await wait(250);
- const auditLog = await guild.fetchAuditLogs({type: event});
+ const auditLog = await guild.fetchAuditLogs({ type: event });
return auditLog as unknown as Discord.GuildAuditLogsEntry[];
}
@@ -56,16 +59,23 @@
const config = await client.database.guilds.read(log.hidden.guild);
if (!config.logging.logs.enabled) return;
if (!(log.meta.calculateType === true)) {
- if(!toHexArray(config.logging.logs.toLog).includes(log.meta.calculateType)) return console.log("Not logging this type of event");
+ if (
+ !toHexArray(config.logging.logs.toLog).includes(
+ log.meta.calculateType
+ )
+ )
+ return console.log("Not logging this type of event");
}
if (config.logging.logs.channel) {
- const channel = await client.channels.fetch(config.logging.logs.channel) as Discord.TextChannel;
+ const channel = (await client.channels.fetch(
+ config.logging.logs.channel
+ )) as Discord.TextChannel | null;
const description: Record<string, string> = {};
- Object.entries(log.list).map(entry => {
+ Object.entries(log.list).map((entry) => {
const key: string = entry[0];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const value: any = entry[1];
- if(value.displayValue) {
+ if (value.displayValue) {
description[key] = value.displayValue;
} else {
description[key] = value;
@@ -74,19 +84,22 @@
if (channel) {
log.separate = log.separate || {};
const embed = new Discord.MessageEmbed()
- .setTitle(`${getEmojiByName(log.meta.emoji)} ${log.meta.displayName}`)
+ .setTitle(
+ `${getEmojiByName(log.meta.emoji)} ${
+ log.meta.displayName
+ }`
+ )
.setDescription(
(log.separate.start ? log.separate.start + "\n" : "") +
- generateKeyValueList(description) +
- (log.separate.end ? "\n" + log.separate.end : "")
+ generateKeyValueList(description) +
+ (log.separate.end ? "\n" + log.separate.end : "")
)
.setTimestamp(log.meta.timestamp)
.setColor(log.meta.color);
- channel.send({embeds: [embed]});
+ channel.send({ embeds: [embed] });
}
}
}
}
-
export default {};