mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Turn on strict TS compilation. Fix up and tweak types accordingly.
This commit is contained in:
parent
690955a399
commit
629002b8d9
172 changed files with 720 additions and 534 deletions
|
@ -1,16 +1,9 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CensorPluginType } from "../types";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { AnyInvite, Embed, GuildInvite } from "eris";
|
||||
import { Embed, Invite } from "eris";
|
||||
import { ZalgoRegex } from "../../../data/Zalgo";
|
||||
import {
|
||||
getInviteCodesInString,
|
||||
getUrlsInString,
|
||||
resolveMember,
|
||||
resolveInvite,
|
||||
isGuildInvite,
|
||||
isRESTGuildInvite,
|
||||
} from "../../../utils";
|
||||
import { getInviteCodesInString, getUrlsInString, resolveMember, resolveInvite, isGuildInvite } from "../../../utils";
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
import { censorMessage } from "./censorMessage";
|
||||
import escapeStringRegexp from "escape-string-regexp";
|
||||
|
@ -59,7 +52,7 @@ export async function applyFiltersToMsg(
|
|||
|
||||
const inviteCodes = getInviteCodesInString(messageContent);
|
||||
|
||||
const invites: Array<AnyInvite | null> = await Promise.all(
|
||||
const invites: Array<Invite | null> = await Promise.all(
|
||||
inviteCodes.map(code => resolveInvite(pluginData.client, code)),
|
||||
);
|
||||
|
||||
|
@ -75,7 +68,7 @@ export async function applyFiltersToMsg(
|
|||
return true;
|
||||
}
|
||||
|
||||
if (isRESTGuildInvite(invite)) {
|
||||
if (isGuildInvite(invite)) {
|
||||
if (inviteGuildWhitelist && !inviteGuildWhitelist.includes(invite.guild.id)) {
|
||||
censorMessage(
|
||||
pluginData,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue