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

Add delete_with_command config option to the tags plugin

This commit is contained in:
Dragory 2019-01-06 15:34:42 +02:00
parent 681517341e
commit 9bfe160e0e

View file

@ -18,7 +18,7 @@ export class TagsPlugin extends Plugin {
return { return {
config: { config: {
prefix: "!!", prefix: "!!",
deleteWithCommand: true delete_with_command: true
}, },
permissions: { permissions: {
@ -109,9 +109,11 @@ export class TagsPlugin extends Plugin {
const responseMsg = await channel.createMessage(tag.body); const responseMsg = await channel.createMessage(tag.body);
// Save the command-response message pair once the message is in our database // Save the command-response message pair once the message is in our database
this.savedMessages.onceMessageAvailable(responseMsg.id, async theMsg => { if (this.configValueForMemberIdAndChannelId(msg.user_id, msg.channel_id, "delete_with_command")) {
await this.tags.addResponse(msg.id, responseMsg.id); this.savedMessages.onceMessageAvailable(responseMsg.id, async () => {
}); await this.tags.addResponse(msg.id, responseMsg.id);
});
}
} }
async onMessageDelete(msg: SavedMessage) { async onMessageDelete(msg: SavedMessage) {