3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-19 16:05:01 +00:00

Cache invites when resolving them

This commit is contained in:
Dragory 2019-10-13 00:21:35 +03:00
parent 5e72693a3b
commit 9ac761b4eb
3 changed files with 20 additions and 16 deletions

View file

@ -167,7 +167,7 @@ export class CensorPlugin extends ZeppelinPlugin<TConfigSchema> {
const inviteCodes = getInviteCodesInString(messageContent);
let invites: Invite[] = await Promise.all(inviteCodes.map(code => this.bot.getInvite(code).catch(() => null)));
let invites: Invite[] = await Promise.all(inviteCodes.map(code => this.resolveInvite(code)));
invites = invites.filter(v => !!v);