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:
parent
bb8ef2d511
commit
ba01dd9ce5
4 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue