mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
chore: resolve eslint issues
This commit is contained in:
parent
09125956a0
commit
673ec7b09a
19 changed files with 35 additions and 2 deletions
|
@ -159,6 +159,8 @@ export class GuildCases extends BaseGuildRepository {
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err?.code === "ER_DUP_ENTRY") {
|
if (err?.code === "ER_DUP_ENTRY") {
|
||||||
if (data.audit_log_id) {
|
if (data.audit_log_id) {
|
||||||
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.trace(`Tried to insert case with duplicate audit_log_id`);
|
console.trace(`Tried to insert case with duplicate audit_log_id`);
|
||||||
return this.createInternal({
|
return this.createInternal({
|
||||||
...data,
|
...data,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, MINUTES } from "../../utils";
|
import { lazyMemoize, MINUTES } from "../../utils";
|
||||||
import { Archives } from "../Archives";
|
import { Archives } from "../Archives";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, memoize, MINUTES } from "../../utils";
|
import { lazyMemoize, memoize, MINUTES } from "../../utils";
|
||||||
import { Mutes } from "../Mutes";
|
import { Mutes } from "../Mutes";
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, MINUTES } from "../../utils";
|
import { lazyMemoize, MINUTES } from "../../utils";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, MINUTES } from "../../utils";
|
import { lazyMemoize, MINUTES } from "../../utils";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { HOURS, MINUTES } from "../../utils";
|
import { HOURS, MINUTES } from "../../utils";
|
||||||
import {
|
import {
|
||||||
deleteStalePhishermanCacheEntries,
|
deleteStalePhishermanCacheEntries,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { MINUTES } from "../../utils";
|
import { MINUTES } from "../../utils";
|
||||||
import { cleanupMessages } from "../cleanup/messages";
|
import { cleanupMessages } from "../cleanup/messages";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, MINUTES } from "../../utils";
|
import { lazyMemoize, MINUTES } from "../../utils";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// tslint:disable:no-console
|
||||||
|
|
||||||
import { lazyMemoize, MINUTES } from "../../utils";
|
import { lazyMemoize, MINUTES } from "../../utils";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";
|
||||||
|
|
|
@ -184,6 +184,8 @@ setInterval(() => {
|
||||||
}, 500);
|
}, 500);
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const avgBlocking = avgTotal / (avgCount || 1);
|
const avgBlocking = avgTotal / (avgCount || 1);
|
||||||
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(`Average blocking in the last 5min: ${avgBlocking / avgTotal}ms`);
|
console.log(`Average blocking in the last 5min: ${avgBlocking / avgTotal}ms`);
|
||||||
avgTotal = 0;
|
avgTotal = 0;
|
||||||
avgCount = 0;
|
avgCount = 0;
|
||||||
|
@ -387,6 +389,8 @@ connect().then(async () => {
|
||||||
lowestGlobalRemaining = Math.min(lowestGlobalRemaining, (client as any).rest.globalRemaining);
|
lowestGlobalRemaining = Math.min(lowestGlobalRemaining, (client as any).rest.globalRemaining);
|
||||||
}, 100);
|
}, 100);
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log("Lowest global remaining in the past 15 seconds:", lowestGlobalRemaining);
|
console.log("Lowest global remaining in the past 15 seconds:", lowestGlobalRemaining);
|
||||||
lowestGlobalRemaining = Infinity;
|
lowestGlobalRemaining = Infinity;
|
||||||
}, 15000);
|
}, 15000);
|
||||||
|
@ -399,6 +403,8 @@ connect().then(async () => {
|
||||||
.slice(0, 5)
|
.slice(0, 5)
|
||||||
.map(([key, count]) => `${count}x ${key}`)
|
.map(([key, count]) => `${count}x ${key}`)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(`Top query entries in the past 5 minutes:\n${topEntriesStr}`);
|
console.log(`Top query entries in the past 5 minutes:\n${topEntriesStr}`);
|
||||||
}, 5 * MINUTES);
|
}, 5 * MINUTES);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// tslint-disable:no-console
|
// tslint:disable:no-console
|
||||||
|
|
||||||
export const logger = {
|
export const logger = {
|
||||||
info(...args: Parameters<typeof console.log>) {
|
info(...args: Parameters<typeof console.log>) {
|
||||||
|
|
|
@ -17,6 +17,8 @@ export const CleanAction = automodAction({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageIdsToDeleteByChannelId.get(context.message.channel_id)!.includes(context.message.id)) {
|
if (messageIdsToDeleteByChannelId.get(context.message.channel_id)!.includes(context.message.id)) {
|
||||||
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.warn(`Message ID to delete was already present: ${pluginData.guild.name}, rule ${ruleName}`);
|
console.warn(`Message ID to delete was already present: ${pluginData.guild.name}, rule ${ruleName}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ interface GuildAccessMonitorPluginType extends BasePluginType {
|
||||||
|
|
||||||
async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginType>, guild: Guild) {
|
async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginType>, guild: Guild) {
|
||||||
if (!(await pluginData.state.allowedGuilds.isAllowed(guild.id))) {
|
if (!(await pluginData.state.allowedGuilds.isAllowed(guild.id))) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(`Non-allowed server ${guild.name} (${guild.id}), leaving`);
|
console.log(`Non-allowed server ${guild.name} (${guild.id}), leaving`);
|
||||||
guild.leave();
|
guild.leave();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ export async function reloadChangedGuilds(pluginData: GlobalPluginData<GuildConf
|
||||||
if (!item.key.startsWith("guild-")) continue;
|
if (!item.key.startsWith("guild-")) continue;
|
||||||
|
|
||||||
const guildId = item.key.slice("guild-".length) as Snowflake;
|
const guildId = item.key.slice("guild-".length) as Snowflake;
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(`Config changed, reloading guild ${guildId}`);
|
console.log(`Config changed, reloading guild ${guildId}`);
|
||||||
await pluginData.getKnubInstance().reloadGuild(guildId);
|
await pluginData.getKnubInstance().reloadGuild(guildId);
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ export async function getOrCreateWebhookForChannel(
|
||||||
});
|
});
|
||||||
return [webhook.id, webhook.token!];
|
return [webhook.id, webhook.token!];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.warn(`Error when trying to create webhook for ${pluginData.guild.id}/${channel.id}: ${err.message}`);
|
console.warn(`Error when trying to create webhook for ${pluginData.guild.id}/${channel.id}: ${err.message}`);
|
||||||
|
|
||||||
if (isDiscordAPIError(err) && err.code === 50013) {
|
if (isDiscordAPIError(err) && err.code === 50013) {
|
||||||
|
|
|
@ -71,7 +71,8 @@ export async function actualMuteUserCmd(
|
||||||
} else {
|
} else {
|
||||||
logger.error(`Failed to mute user ${user.id}: ${e.stack}`);
|
logger.error(`Failed to mute user ${user.id}: ${e.stack}`);
|
||||||
if (user.id == null) {
|
if (user.id == null) {
|
||||||
// tslint-disable-next-line:no-console
|
// FIXME: Debug
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.trace("[DEBUG] Null user.id for mute");
|
console.trace("[DEBUG] Null user.id for mute");
|
||||||
}
|
}
|
||||||
sendErrorMessage(pluginData, msg.channel as TextChannel, "Could not mute the user");
|
sendErrorMessage(pluginData, msg.channel as TextChannel, "Could not mute the user");
|
||||||
|
|
|
@ -32,6 +32,7 @@ export async function postReminder(pluginData: GuildPluginData<RemindersPluginTy
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// If we were unable to post the reminder, we'll try again later
|
// If we were unable to post the reminder, we'll try again later
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.warn(`Error when posting reminder for ${reminder.user_id} in guild ${reminder.guild_id}: ${String(err)}`);
|
console.warn(`Error when posting reminder for ${reminder.user_id} in guild ${reminder.guild_id}: ${String(err)}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ export function decodeAndValidateStrict<T extends t.HasProps>(
|
||||||
(result) => {
|
(result) => {
|
||||||
// Make sure there are no extra properties
|
// Make sure there are no extra properties
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(
|
console.log(
|
||||||
"JSON.stringify() check:",
|
"JSON.stringify() check:",
|
||||||
JSON.stringify(value) === JSON.stringify(result)
|
JSON.stringify(value) === JSON.stringify(result)
|
||||||
|
|
|
@ -19,4 +19,5 @@ const yaml = new YAML(src);
|
||||||
json.plugins.myplugin.config.can_do_thing = false;
|
json.plugins.myplugin.config.can_do_thing = false;
|
||||||
yaml.json = json;
|
yaml.json = json;
|
||||||
|
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(yaml.yaml);
|
console.log(yaml.yaml);
|
||||||
|
|
Loading…
Add table
Reference in a new issue