@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
75 lines (74 loc) • 1.98 kB
TypeScript
import type { ChatBot } from './ChatBot';
import { Base } from './Base';
import type { EventSubConnection } from '../enums';
/**
* The base class for a user.
*/
export declare class BaseUser<T extends EventSubConnection> extends Base<T> {
/**
* The id of the user.
*/
readonly id: string;
/**
* The username of the user.
*/
readonly username: string;
/**
* The display name of the user.
*/
readonly displayName: string;
/**
* Creates a new instance of the base user.
* @param chatbot The current instance of the chatbot.
* @param data The base data of the user.
*/
constructor(chatbot: ChatBot<T>, data: BaseUserData);
/**
* Gets the chatroom of the user.
* @returns The chatroom of the user.
*/
chatroom(): Promise<import("./ChatRoom").ChatRoom<T>>;
/**
* Fetches the current user from the API.
* @returns The fetched user from the API.
*/
fetch(): Promise<import("structures").User<T>>;
/**
* Returns the mention of the user.
*/
toString(): string;
/**
* Fetches the current stream of the user from the API.
* @returns The current stream or null if the stream is offline.
*/
stream(): Promise<import("structures").Stream<T> | null>;
/**
* Checks whether the user is currently streaming.
* @returns A boolean indicating whether the user is currently streaming.
*/
inStream(): Promise<boolean>;
channel(): Promise<import("structures").Channel<T>>;
/**
* Sends a whisper to the user.
* @param message The message to send.
* @returns
*/
whisper(message: string): Promise<void>;
}
/**
* The base data of an user.
*/
export interface BaseUserData {
/**
* The id of the user.
*/
id: string;
/**
* The username of the user.
*/
login: string;
/**
* The display name of the user.
*/
display_name: string;
}