3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00

Make several event handlers non-blocking for performance

This commit is contained in:
Dragory 2019-01-13 23:31:09 +02:00
parent bb8ef2d511
commit ba01dd9ce5
4 changed files with 10 additions and 3 deletions

View file

@ -81,6 +81,7 @@ export class PingableRoles extends Plugin {
}
@d.event("typingStart")
@d.nonBlocking()
async onTypingStart(channel: TextableChannel, user: User) {
const pingableRoles = await this.getPingableRolesForChannel(channel.id);
if (pingableRoles.length === 0) return;
@ -98,6 +99,7 @@ export class PingableRoles extends Plugin {
}
@d.event("messageCreate")
@d.nonBlocking()
async onMessageCreate(msg: Message) {
const pingableRoles = await this.getPingableRolesForChannel(msg.channel.id);
if (pingableRoles.length === 0) return;