@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
33 lines (32 loc) • 1.23 kB
TypeScript
import type { Badge } from '@twitchfy/eventsub';
import type { ChatBot } from '../ChatBot';
import { Base } from '../Base';
import type { EventSubConnection } from '../../enums';
/**
* Represents an user badge's manager.
*/
export declare class BadgeManager<T extends EventSubConnection> extends Base<T> {
/**
* The data containing the user's badges returned by the EventSub.
* @internal
*/
private data;
/**
* Creates a new instance of the badge manager.
* @param chatbot The current instance of the chatbot.
* @param data The data containing the user's badges returned by the EventSub.
*/
constructor(chatbot: ChatBot<T>, data: Badge[]);
/**
* Checks if the user has a specific badge.
* @param id The id of the badge to check. Possible values could be `subscriber`, `vip, `moderator`.
* @returns A boolean determining whether the user has the badge.
*/
has(id: string): boolean;
/**
* Gets a user's badge.
* @param id The id of the badge to get. Possible values could be `subscriber`, `vip, `moderator`.
* @returns The badge if the user has it. If not it will return `undefined`.
*/
get(id: string): Badge | undefined;
}