chore: fix lint errors; tweak lint rules

This commit is contained in:
Dragory 2023-05-08 22:58:51 +03:00
parent 9b3d6f5d68
commit 5f194bf1ef
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
115 changed files with 176 additions and 264 deletions

View file

@ -9,13 +9,6 @@ import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin"
import { ILogTypeData, LogsPluginType, TLogChannel, TLogChannelMap } from "../types";
import { getLogMessage } from "./getLogMessage";
const excludedUserProps = ["user", "member", "mod"];
const excludedRoleProps = ["message.member.roles", "member.roles"];
function isRoleArray(value: any): value is string[] {
return Array.isArray(value);
}
interface ExclusionData {
userId?: Snowflake | null;
bot?: boolean | null;
@ -86,7 +79,7 @@ export async function log<TLogType extends keyof ILogTypeData>(
const logChannels: TLogChannelMap = pluginData.config.get().channels;
const typeStr = LogType[type];
logChannelLoop: for (const [channelId, opts] of Object.entries(logChannels)) {
for (const [channelId, opts] of Object.entries(logChannels)) {
const channel = pluginData.guild.channels.cache.get(channelId as Snowflake);
if (!channel?.isTextBased()) continue;
if (pluginData.state.channelCooldowns.isOnCooldown(channelId)) continue;