@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
54 lines (53 loc) • 1.66 kB
TypeScript
import type { Badge } from '@twitchfy/eventsub';
import type { BaseUserData } from './BaseUser';
import { BaseUser } from './BaseUser';
import type { ChatBot } from './ChatBot';
import { BadgeManager } from './managers';
import type { EventSubConnection } from '../enums';
/**
* Represents the author of a received message.
* @extends {BaseUser}
*/
export declare class Author<T extends EventSubConnection> extends BaseUser<T> {
/**
* The name color of the author in HEX RGB format.
*/
readonly color: string;
/**
* The set of badges of the author.
*/
readonly badges: BadgeManager<T>;
/**
* Creates a new instance of the author.
* @param chatbot The current instance of the chatbot.
* @param data The data of the user.
*/
constructor(chatbot: ChatBot<T>, data: BaseUserData & {
badges: Badge[];
color: string;
});
/**
* Checks if the author is the broadcaster of the chatroom.
*/
get broadcaster(): boolean;
/**
* Checks if the author is a moderator of the chatroom.
*/
get moderator(): boolean;
/**
* Checks if the author is a VIP of the chatroom.
*/
get vip(): boolean;
/**
* Checks if the author is a subscriber of the channel.
*/
get subscriber(): boolean;
/**
* Gets the subscription tier of the author. If the author is not a subscriber, it will return a nullish value.
*/
get subscriptionTier(): number | null;
/**
* Gets the subscription months of the author. If the author is not a subscriber, it will return `0`.
*/
get subscriptionMonths(): number;
}