mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
Add delete_with_command config option to the tags plugin
This commit is contained in:
parent
681517341e
commit
9bfe160e0e
1 changed files with 6 additions and 4 deletions
|
@ -18,7 +18,7 @@ export class TagsPlugin extends Plugin {
|
|||
return {
|
||||
config: {
|
||||
prefix: "!!",
|
||||
deleteWithCommand: true
|
||||
delete_with_command: true
|
||||
},
|
||||
|
||||
permissions: {
|
||||
|
@ -109,9 +109,11 @@ export class TagsPlugin extends Plugin {
|
|||
const responseMsg = await channel.createMessage(tag.body);
|
||||
|
||||
// Save the command-response message pair once the message is in our database
|
||||
this.savedMessages.onceMessageAvailable(responseMsg.id, async theMsg => {
|
||||
await this.tags.addResponse(msg.id, responseMsg.id);
|
||||
});
|
||||
if (this.configValueForMemberIdAndChannelId(msg.user_id, msg.channel_id, "delete_with_command")) {
|
||||
this.savedMessages.onceMessageAvailable(responseMsg.id, async () => {
|
||||
await this.tags.addResponse(msg.id, responseMsg.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async onMessageDelete(msg: SavedMessage) {
|
||||
|
|
Loading…
Add table
Reference in a new issue