mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 17:14:15 +02:00
refactor(arabot): insert awaits to schedule creators
This commit is contained in:
parent
b6b50ea450
commit
d90c985cec
@ -56,7 +56,10 @@ import { rolesToString } from '#utils/formatter';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class VerificationJoinVCListener extends Listener {
|
||||
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
|
||||
public constructor(
|
||||
context: Listener.LoaderContext,
|
||||
options: Listener.Options,
|
||||
) {
|
||||
super(context, {
|
||||
...options,
|
||||
event: 'voiceStateUpdate',
|
||||
@ -151,14 +154,15 @@ export class VerificationJoinVCListener extends Listener {
|
||||
]);
|
||||
|
||||
// Start 15-minute timer if verifier does not join
|
||||
this.container.tasks.create({
|
||||
await this.container.tasks.create(
|
||||
{
|
||||
name: 'verifyTimeout',
|
||||
payload: {
|
||||
channelId: channel.id,
|
||||
userId: member.id,
|
||||
},
|
||||
},
|
||||
900_000 // 15 minutes
|
||||
900_000, // 15 minutes
|
||||
);
|
||||
}
|
||||
|
||||
@ -507,7 +511,8 @@ export class VerificationJoinVCListener extends Listener {
|
||||
await giveVerificationRoles(user, info.roles);
|
||||
// Add timeout if they do not have activist role
|
||||
if (!info.roles.activist) {
|
||||
this.container.tasks.create({
|
||||
await this.container.tasks.create(
|
||||
{
|
||||
name: 'verifyUnblock',
|
||||
payload: {
|
||||
userId: user.id,
|
||||
|
@ -37,7 +37,10 @@ import { fibonacci } from '#utils/maths';
|
||||
import IDs from '#utils/ids';
|
||||
|
||||
export class VerificationLeaveVCListener extends Listener {
|
||||
public constructor(context: Listener.LoaderContext, options: Listener.Options) {
|
||||
public constructor(
|
||||
context: Listener.LoaderContext,
|
||||
options: Listener.Options,
|
||||
) {
|
||||
super(context, {
|
||||
...options,
|
||||
event: 'voiceStateUpdate',
|
||||
@ -103,7 +106,8 @@ export class VerificationLeaveVCListener extends Listener {
|
||||
// Creates the length of the time for the ban
|
||||
const banLength = fibonacci(incompleteCount) * 3600_000;
|
||||
|
||||
this.container.tasks.create({
|
||||
await this.container.tasks.create(
|
||||
{
|
||||
name: 'verifyUnblock',
|
||||
payload: {
|
||||
userId: user.id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user