From d938df75cd505a7d6af36b6760ebd6303c475d07 Mon Sep 17 00:00:00 2001 From: Dragory Date: Mon, 9 Jul 2018 02:59:37 +0300 Subject: [PATCH] Use formatTemplateString in mute command --- src/plugins/ModActions.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/ModActions.ts b/src/plugins/ModActions.ts index d7ff48ee..36027724 100644 --- a/src/plugins/ModActions.ts +++ b/src/plugins/ModActions.ts @@ -11,7 +11,7 @@ import * as moment from "moment-timezone"; import { GuildModActions } from "../data/GuildModActions"; import { convertDelayStringToMS, - errorMessage, + errorMessage, formatTemplateString, stripObjectToScalars, successMessage } from "../utils"; @@ -316,9 +316,10 @@ export class ModActionsPlugin extends Plugin { // Message the user informing them of the mute if (args.reason) { - const muteMessage = this.configValue("mute_message") - .replace("{guildName}", this.guild.name) - .replace("{reason}", args.reason); + const muteMessage = formatTemplateString(this.configValue("mute_message"), { + guildName: this.guild.name, + reason: args.reason + }); if (this.configValue("dm_on_mute")) { const dmChannel = await this.bot.getDMChannel(args.member.id);