Class that manages the queue for a specific category

Hierarchy

  • HelpQueueV2

Constructors

Properties

_activeHelperIds: Set<string> = ...
_seriousModeEnabled: boolean = false
_students: Helpee[] = []

The actual queue of students

_timeUntilAutoClear: AutoClearTimeout = 'AUTO_CLEAR_DISABLED'

When to automatically remove everyone

notifGroup: Collection<string, GuildMember> = ...

The set of students to notify when queue opens, key is Guildmember.id

queueChannel: QueueChannel
queueExtensions: IQueueExtension[]
timers: Collection<QueueTimerType, Timer | Timeout> = ...

Keeps track of all the setTimout / setIntervals we started

Accessors

Methods

  • Adds a student to the notification group. Used for JoinNotif button

    Parameters

    • targetStudent: GuildMember

    Returns Promise<void>

  • Close a queue with a helper

    Throws

    QueueError: do nothing if queue is closed

    Parameters

    • helperMember: GuildMember

      member with Staff/Admin that used /stop

    Returns Promise<void>

  • Dequeue this particular queue with a helper

    Throws

    QueueError when

    • Queue is not open
    • No student is here
    • helperMember is not one of the helpers
    • targetStudentMember specified but not in queue

    Parameters

    • helperMember: GuildMember

      the member that triggered dequeue

    • Optional targetStudentMember: GuildMember

      the student to look for if specified

    Returns Promise<Readonly<Helpee>>

  • Enqueue a student

    Throws

    QueueError

    Parameters

    • studentMember: GuildMember

      the complete Helpee object

    Returns Promise<void>

  • Queue delete procedure, let the extension process first before getting deleted

    Returns Promise<void>

  • Open a queue with a helper

    Throws

    QueueError: do nothing if helperMemeber is already helping

    Parameters

    • helperMember: GuildMember

      member with Staff/Admin that used /start

    • notify: boolean

      whether to notify everyone in the notif group

    Returns Promise<void>

  • Adds a student to the notification group.

    • Used for RemoveNotif button

    Parameters

    • targetStudent: GuildMember

    Returns Promise<void>

  • Remove a student from the queue. Used for /leave

    Throws

    QueueError: the student is not in the queue

    Parameters

    • targetStudentMember: GuildMember

      the student to remove

    Returns Promise<Helpee>

  • Sets up auto clear parameters

    • The timer won't start until autoClearQueue is called

    Parameters

    • hours: number

      clear queue after this many hours

    • minutes: number
    • enable: boolean

      whether to enable auto clear, overrides 'hours'

    Returns void

  • Starts the timer that will clear all the students after a certain number of hours

    Returns void

  • Re-renders the queue message. Composes the queue view model, then sends it to QueueDisplay

    Returns Promise<void>

  • Parameters

    • seriousModeEnabled: boolean

    Returns Promise<void>

  • Asynchronously creates a clean queue

    Parameters

    • queueChannel: QueueChannel

      the corresponding text channel and its name

    • user: User

      YABOB's client object. Used for queue rendering

    • everyoneRole: Role

      used for locking the queue

    • Optional backupData: QueueBackup & {
          hoursUntilAutoClear: AutoClearTimeout;
          seriousModeEnabled: boolean;
      }

      backup queue data directly passed to the constructor

    Returns Promise<HelpQueueV2>

Generated using TypeDoc