mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-20 00:05:04 +00:00
Add moderator to mod action template options
This commit is contained in:
parent
356c86f033
commit
38df930739
4 changed files with 9 additions and 1 deletions
|
@ -33,6 +33,7 @@ export async function banUserId(
|
|||
const banMessage = await renderTemplate(config.ban_message, {
|
||||
guildName: pluginData.guild.name,
|
||||
reason,
|
||||
moderator: banOptions.caseArgs?.modId ? await resolveUser(pluginData.client, banOptions.caseArgs?.modId) : "",
|
||||
});
|
||||
|
||||
const contactMethods = banOptions?.contactMethods
|
||||
|
|
|
@ -26,6 +26,7 @@ export async function kickMember(
|
|||
const kickMessage = await renderTemplate(config.kick_message, {
|
||||
guildName: pluginData.guild.name,
|
||||
reason,
|
||||
moderator: kickOptions.caseArgs?.modId ? await resolveUser(pluginData.client, kickOptions.caseArgs?.modId) : "",
|
||||
});
|
||||
|
||||
const contactMethods = kickOptions?.contactMethods
|
||||
|
|
|
@ -7,6 +7,7 @@ import { waitForReaction } from "knub/dist/helpers";
|
|||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { renderTemplate } from "../../../templateFormatter";
|
||||
|
||||
export async function warnMember(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
@ -16,7 +17,11 @@ export async function warnMember(
|
|||
): Promise<WarnResult | null> {
|
||||
const config = pluginData.config.get();
|
||||
|
||||
const warnMessage = config.warn_message.replace("{guildName}", pluginData.guild.name).replace("{reason}", reason);
|
||||
const warnMessage = await renderTemplate(config.warn_message, {
|
||||
guildName: pluginData.guild.name,
|
||||
reason,
|
||||
moderator: warnOptions.caseArgs?.modId ? await resolveUser(pluginData.client, warnOptions.caseArgs?.modId) : "",
|
||||
});
|
||||
const contactMethods = warnOptions?.contactMethods
|
||||
? warnOptions.contactMethods
|
||||
: getDefaultContactMethods(pluginData, "warn");
|
||||
|
|
|
@ -87,6 +87,7 @@ export async function muteUser(
|
|||
guildName: pluginData.guild.name,
|
||||
reason: reason || "None",
|
||||
time: timeUntilUnmute,
|
||||
moderator: muteOptions.caseArgs?.modId ? await resolveUser(pluginData.client, muteOptions.caseArgs?.modId) : "",
|
||||
}));
|
||||
|
||||
if (muteMessage && user instanceof User) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue