Post: don't confirm post commands if the target channel is the same as the command channel
This commit is contained in:
parent
5aa1f3cec9
commit
aab3a0cb1d
1 changed files with 6 additions and 2 deletions
|
@ -261,9 +261,11 @@ 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"]);
|
||||||
|
if (args.channel.id !== msg.channel.id) {
|
||||||
this.sendSuccessMessage(msg.channel, `Message posted in <#${args.channel.id}>`);
|
this.sendSuccessMessage(msg.channel, `Message posted in <#${args.channel.id}>`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* COMMAND: Post a message with an embed as the bot to the specified channel
|
* COMMAND: Post a message with an embed as the bot to the specified channel
|
||||||
|
@ -349,8 +351,10 @@ 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);
|
||||||
|
|
||||||
|
if (msg.channel.id !== args.channel.id) {
|
||||||
await this.sendSuccessMessage(msg.channel, `Embed posted in <#${args.channel.id}>`);
|
await this.sendSuccessMessage(msg.channel, `Embed posted in <#${args.channel.id}>`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (args.content) {
|
if (args.content) {
|
||||||
const prefix = this.guildConfig.prefix || "!";
|
const prefix = this.guildConfig.prefix || "!";
|
||||||
|
|
Loading…
Add table
Reference in a new issue