automod: fix error when matching an unknown invite
This commit is contained in:
parent
6f30356065
commit
ebdeabdc32
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ export const MatchInvitesTrigger = automodTrigger<MatchResultType>()({
|
||||||
|
|
||||||
for (const code of uniqueInviteCodes) {
|
for (const code of uniqueInviteCodes) {
|
||||||
const invite = await resolveInvite(pluginData.client, code);
|
const invite = await resolveInvite(pluginData.client, code);
|
||||||
if (!invite || !isGuildInvite(invite)) return { code };
|
if (!invite || !isGuildInvite(invite)) return { extra: { type, code } };
|
||||||
|
|
||||||
if (trigger.include_guilds && trigger.include_guilds.includes(invite.guild.id)) {
|
if (trigger.include_guilds && trigger.include_guilds.includes(invite.guild.id)) {
|
||||||
return { extra: { type, code, invite } };
|
return { extra: { type, code, invite } };
|
||||||
|
|
Loading…
Add table
Reference in a new issue