3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Use formatTemplateString in mute command

This commit is contained in:
Dragory 2018-07-09 02:59:37 +03:00
parent 82daf87fbf
commit d938df75cd

View file

@ -11,7 +11,7 @@ import * as moment from "moment-timezone";
import { GuildModActions } from "../data/GuildModActions"; import { GuildModActions } from "../data/GuildModActions";
import { import {
convertDelayStringToMS, convertDelayStringToMS,
errorMessage, errorMessage, formatTemplateString,
stripObjectToScalars, stripObjectToScalars,
successMessage successMessage
} from "../utils"; } from "../utils";
@ -316,9 +316,10 @@ export class ModActionsPlugin extends Plugin {
// Message the user informing them of the mute // Message the user informing them of the mute
if (args.reason) { if (args.reason) {
const muteMessage = this.configValue("mute_message") const muteMessage = formatTemplateString(this.configValue("mute_message"), {
.replace("{guildName}", this.guild.name) guildName: this.guild.name,
.replace("{reason}", args.reason); reason: args.reason
});
if (this.configValue("dm_on_mute")) { if (this.configValue("dm_on_mute")) {
const dmChannel = await this.bot.getDMChannel(args.member.id); const dmChannel = await this.bot.getDMChannel(args.member.id);