From aab3a0cb1df5d404d46884a0762514eed97986eb Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 4 Aug 2019 13:18:02 +0300 Subject: [PATCH] Post: don't confirm post commands if the target channel is the same as the command channel --- src/plugins/Post.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/Post.ts b/src/plugins/Post.ts index 5822b17a..4d8572bd 100644 --- a/src/plugins/Post.ts +++ b/src/plugins/Post.ts @@ -261,7 +261,9 @@ export class PostPlugin extends ZeppelinPlugin { } else { // Post the message immediately await this.postMessage(args.channel, args.content, msg.attachments, args["enable-mentions"]); - this.sendSuccessMessage(msg.channel, `Message posted in <#${args.channel.id}>`); + if (args.channel.id !== msg.channel.id) { + this.sendSuccessMessage(msg.channel, `Message posted in <#${args.channel.id}>`); + } } } @@ -349,7 +351,9 @@ export class PostPlugin extends ZeppelinPlugin { const createdMsg = await args.channel.createMessage({ embed }); this.savedMessages.setPermanent(createdMsg.id); - await this.sendSuccessMessage(msg.channel, `Embed posted in <#${args.channel.id}>`); + if (msg.channel.id !== args.channel.id) { + await this.sendSuccessMessage(msg.channel, `Embed posted in <#${args.channel.id}>`); + } } if (args.content) {