PingableRoles: clear the cache properly

This commit is contained in:
Dragory 2019-01-12 14:10:42 +02:00
parent feb977eee0
commit 69bcfb8bbd

View file

@ -56,6 +56,8 @@ export class PingableRoles extends Plugin {
} }
await this.pingableRoles.delete(args.channelId, args.role.id); await this.pingableRoles.delete(args.channelId, args.role.id);
this.cache.delete(args.channelId);
msg.channel.createMessage( msg.channel.createMessage(
successMessage(`**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`) successMessage(`**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`)
); );
@ -73,6 +75,8 @@ export class PingableRoles extends Plugin {
} }
await this.pingableRoles.add(args.channelId, args.role.id); await this.pingableRoles.add(args.channelId, args.role.id);
this.cache.delete(args.channelId);
msg.channel.createMessage(successMessage(`**${args.role.name}** has been set as pingable in <#${args.channelId}>`)); msg.channel.createMessage(successMessage(`**${args.role.name}** has been set as pingable in <#${args.channelId}>`));
} }