Post: don't confirm post commands if the target channel is the same as the command channel

This commit is contained in:
Dragory 2019-08-04 13:18:02 +03:00
parent 5aa1f3cec9
commit aab3a0cb1d

View file

@ -261,7 +261,9 @@ export class PostPlugin extends ZeppelinPlugin<TConfigSchema> {
} else { } else {
// Post the message immediately // Post the message immediately
await this.postMessage(args.channel, args.content, msg.attachments, args["enable-mentions"]); 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<TConfigSchema> {
const createdMsg = await args.channel.createMessage({ embed }); const createdMsg = await args.channel.createMessage({ embed });
this.savedMessages.setPermanent(createdMsg.id); 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) { if (args.content) {