Make lengthy handlers nonBlocking

This commit is contained in:
Dragory 2019-02-08 22:37:09 +02:00
parent e5032d8cd4
commit b4127a0fd8
2 changed files with 6 additions and 0 deletions

View file

@ -170,6 +170,7 @@ export class LogsPlugin extends Plugin {
}
@d.event("guildBanAdd")
@d.nonBlocking()
async onMemberBan(_, user) {
const relevantAuditLogEntry = await findRelevantAuditLogEntry(
this.guild,
@ -189,6 +190,7 @@ export class LogsPlugin extends Plugin {
}
@d.event("guildBanRemove")
@d.nonBlocking()
async onMemberUnban(_, user) {
const relevantAuditLogEntry = await findRelevantAuditLogEntry(
this.guild,
@ -208,6 +210,7 @@ export class LogsPlugin extends Plugin {
}
@d.event("guildMemberUpdate")
@d.nonBlocking()
async onMemberUpdate(_, member: Member, oldMember: Member) {
if (!oldMember) return;

View file

@ -135,6 +135,7 @@ export class ModActionsPlugin extends ZeppelinPlugin {
* Attempts to find the ban's details in the audit log.
*/
@d.event("guildBanAdd")
@d.nonBlocking()
async onGuildBanAdd(guild: Guild, user: User) {
if (this.isEventIgnored(IgnoredEventType.Ban, user.id)) {
this.clearIgnoredEvent(IgnoredEventType.Ban, user.id);
@ -172,6 +173,7 @@ export class ModActionsPlugin extends ZeppelinPlugin {
* Attempts to find the unban's details in the audit log.
*/
@d.event("guildBanRemove")
@d.nonBlocking()
async onGuildBanRemove(guild: Guild, user: User) {
if (this.isEventIgnored(IgnoredEventType.Unban, user.id)) {
this.clearIgnoredEvent(IgnoredEventType.Unban, user.id);
@ -227,6 +229,7 @@ export class ModActionsPlugin extends ZeppelinPlugin {
}
@d.event("guildMemberRemove")
@d.nonBlocking()
async onGuildMemberRemove(_, member: Member) {
if (this.isEventIgnored(IgnoredEventType.Kick, member.id)) {
this.clearIgnoredEvent(IgnoredEventType.Kick, member.id);