3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

fix: don't attempt to message users off-server

Co-authored-by: metal0 <metal@i0.tf>
This commit is contained in:
Dragory 2023-04-01 21:45:12 +03:00
parent dd2eebd4a5
commit dd1afc4dab
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 10 additions and 8 deletions

View file

@ -1,4 +1,4 @@
import { Snowflake, User } from "discord.js";
import { Snowflake } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { CaseTypes } from "../../../data/CaseTypes";
@ -191,7 +191,7 @@ export async function muteUser(
}),
));
if (muteMessage && user instanceof User) {
if (muteMessage && member) {
let contactMethods: UserNotificationMethod[] = [];
if (muteOptions?.contactMethods) {
@ -211,7 +211,7 @@ export async function muteUser(
}
}
notifyResult = await notifyUser(user, muteMessage, contactMethods);
notifyResult = await notifyUser(member.user, muteMessage, contactMethods);
}
// Create/update a case