mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
Various fixes
This commit is contained in:
parent
2c0e4b37ca
commit
cafcc2839e
15 changed files with 45 additions and 68 deletions
|
@ -1,7 +1,6 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { getContextChannel, isContextInteraction } from "../../../pluginUtils";
|
||||
import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
|
@ -52,12 +51,7 @@ export async function warnMember(
|
|||
}
|
||||
|
||||
if (!notifyResult.success) {
|
||||
const contextIsNotInteraction =
|
||||
warnOptions.retryPromptContext && !isContextInteraction(warnOptions.retryPromptContext);
|
||||
const contextChannel = contextIsNotInteraction ? await getContextChannel(warnOptions.retryPromptContext!) : null;
|
||||
const isValidChannel = contextIsNotInteraction && pluginData.guild.channels.resolve(contextChannel!.id);
|
||||
|
||||
if (!warnOptions.retryPromptContext || !isValidChannel) {
|
||||
if (!warnOptions.retryPromptContext) {
|
||||
return {
|
||||
status: "failed",
|
||||
error: "Failed to message user",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue