BadgeManager
Represents an user badge’s manager.
Extends
Base<T>
Type parameters
| Type parameter |
|---|
T extends EventSubConnection |
Constructors
new BadgeManager()
1new BadgeManager<T>(chatbot: ChatBot<T>, data: Badge[]): BadgeManager<T>Creates a new instance of the badge manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
chatbot | ChatBot<T> | The current instance of the chatbot. |
data | Badge[] | 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
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
chatbot | readonly | ChatBot<T> | The current instance of the chatbot. | Base.chatbot |
Methods
get()
1get(id: string): undefined | BadgeGets a user’s badge.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The id of the badge to get. Possible values could be |
Returns
undefined | Badge
Source
twitchfy/packages/chatbot/src/structures/managers/BadgeManager.ts:41
has()
1has(id: string): booleanChecks if the user has a specific badge.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The 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