Skip to content

BadgeManager

Represents an user badge’s manager.

Extends

  • Base<T>

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new BadgeManager()

1
new BadgeManager<T>(chatbot: ChatBot<T>, data: Badge[]): BadgeManager<T>

Creates a new instance of the badge manager.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataBadge[]The data containing the user’s badges returned by the EventSub.

Returns

BadgeManager<T>

Overrides

Base<T>.constructor

Source

twitchfy/packages/chatbot/src/structures/managers/BadgeManager.ts:22

Properties

PropertyModifierTypeDescriptionInherited from
chatbotreadonlyChatBot<T>The current instance of the chatbot.Base.chatbot

Methods

get()

1
get(id: string): undefined | Badge

Gets a user’s badge.

Parameters

ParameterTypeDescription
idstring

The id of the badge to get. Possible values could be subscriber, vip, moderator.</p><p>@returns The badge if the user has it. If not it will return undefined`.

Returns

undefined | Badge

Source

twitchfy/packages/chatbot/src/structures/managers/BadgeManager.ts:41


has()

1
has(id: string): boolean

Checks if the user has a specific badge.

Parameters

ParameterTypeDescription
idstringThe id of the badge to check. Possible values could be subscriber, vip, moderator`.

Returns

boolean

A boolean determining whether the user has the badge.

Source

twitchfy/packages/chatbot/src/structures/managers/BadgeManager.ts:32