3
0
Fork 0
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:
Dragory 2021-11-03 16:59:08 +02:00
parent 09125956a0
commit 673ec7b09a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
19 changed files with 35 additions and 2 deletions

View file

@ -159,6 +159,8 @@ export class GuildCases extends BaseGuildRepository {
.catch((err) => {
if (err?.code === "ER_DUP_ENTRY") {
if (data.audit_log_id) {
// FIXME: Debug
// tslint:disable-next-line:no-console
console.trace(`Tried to insert case with duplicate audit_log_id`);
return this.createInternal({
...data,

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import { Archives } from "../Archives";
import moment from "moment-timezone";

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, memoize, MINUTES } from "../../utils";
import { Mutes } from "../Mutes";
import Timeout = NodeJS.Timeout;

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import moment from "moment-timezone";
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import moment from "moment-timezone";
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { HOURS, MINUTES } from "../../utils";
import {
deleteStalePhishermanCacheEntries,

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { MINUTES } from "../../utils";
import { cleanupMessages } from "../cleanup/messages";

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import moment from "moment-timezone";
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";

View file

@ -1,3 +1,5 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import moment from "moment-timezone";
import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents";

View file

@ -184,6 +184,8 @@ setInterval(() => {
}, 500);
setInterval(() => {
const avgBlocking = avgTotal / (avgCount || 1);
// FIXME: Debug
// tslint:disable-next-line:no-console
console.log(`Average blocking in the last 5min: ${avgBlocking / avgTotal}ms`);
avgTotal = 0;
avgCount = 0;
@ -387,6 +389,8 @@ connect().then(async () => {
lowestGlobalRemaining = Math.min(lowestGlobalRemaining, (client as any).rest.globalRemaining);
}, 100);
setInterval(() => {
// FIXME: Debug
// tslint:disable-next-line:no-console
console.log("Lowest global remaining in the past 15 seconds:", lowestGlobalRemaining);
lowestGlobalRemaining = Infinity;
}, 15000);
@ -399,6 +403,8 @@ connect().then(async () => {
.slice(0, 5)
.map(([key, count]) => `${count}x ${key}`)
.join("\n");
// FIXME: Debug
// tslint:disable-next-line:no-console
console.log(`Top query entries in the past 5 minutes:\n${topEntriesStr}`);
}, 5 * MINUTES);

View file

@ -1,4 +1,4 @@
// tslint-disable:no-console
// tslint:disable:no-console
export const logger = {
info(...args: Parameters<typeof console.log>) {

View file

@ -17,6 +17,8 @@ export const CleanAction = automodAction({
}
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}`);
continue;
}

View file

@ -13,6 +13,7 @@ interface GuildAccessMonitorPluginType extends BasePluginType {
async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginType>, guild: Guild) {
if (!(await pluginData.state.allowedGuilds.isAllowed(guild.id))) {
// tslint:disable-next-line:no-console
console.log(`Non-allowed server ${guild.name} (${guild.id}), leaving`);
guild.leave();
}

View file

@ -13,6 +13,7 @@ export async function reloadChangedGuilds(pluginData: GlobalPluginData<GuildConf
if (!item.key.startsWith("guild-")) continue;
const guildId = item.key.slice("guild-".length) as Snowflake;
// tslint:disable-next-line:no-console
console.log(`Config changed, reloading guild ${guildId}`);
await pluginData.getKnubInstance().reloadGuild(guildId);

View file

@ -35,6 +35,7 @@ export async function getOrCreateWebhookForChannel(
});
return [webhook.id, webhook.token!];
} catch (err) {
// tslint:disable-next-line:no-console
console.warn(`Error when trying to create webhook for ${pluginData.guild.id}/${channel.id}: ${err.message}`);
if (isDiscordAPIError(err) && err.code === 50013) {

View file

@ -71,7 +71,8 @@ export async function actualMuteUserCmd(
} else {
logger.error(`Failed to mute user ${user.id}: ${e.stack}`);
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");
}
sendErrorMessage(pluginData, msg.channel as TextChannel, "Could not mute the user");

View file

@ -32,6 +32,7 @@ export async function postReminder(pluginData: GuildPluginData<RemindersPluginTy
}
} catch (err) {
// 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)}`);
return;
}

View file

@ -123,6 +123,7 @@ export function decodeAndValidateStrict<T extends t.HasProps>(
(result) => {
// Make sure there are no extra properties
if (debug) {
// tslint:disable-next-line:no-console
console.log(
"JSON.stringify() check:",
JSON.stringify(value) === JSON.stringify(result)

View file

@ -19,4 +19,5 @@ const yaml = new YAML(src);
json.plugins.myplugin.config.can_do_thing = false;
yaml.json = json;
// tslint:disable-next-line:no-console
console.log(yaml.yaml);