@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
101 lines (100 loc) • 3.21 kB
TypeScript
import { Base } from './Base';
import { Message } from './Message';
import { Author } from './Author';
import type { ChatBot } from './ChatBot';
import { ChatRoom } from './ChatRoom';
import type { EventSubConnection } from '../enums';
import type { DefaultConnection, CommandOptionsAux, MessageData, OptionsRecord } from '../types';
/**
* The context of the command.
*/
export declare class TwitchContext<K extends OptionsRecord = {}, T extends EventSubConnection = DefaultConnection> extends Base<T> {
/**
* The message received when the command was run.
*/
readonly message: Message<T>;
/**
* The options of the command.
*/
readonly options: CommandOptionsAux<T, K>;
/**
* The prefix used to run the command.
*/
readonly prefix: string;
/**
* The name of the command.
*/
readonly commandName: string;
/**
* The author of the command.
*/
readonly author: Author<T>;
/**
* The chatroom where the command was run.
*/
readonly chatroom: ChatRoom<T>;
/**
* The data of the command.
*/
private data;
/**
* Creates a new instance of the command context.
* @param chatbot The current instance of the chatbot.
* @param data The data of the command.
*/
constructor(chatbot: ChatBot<T>, data: MessageData<T, K>);
/**
* Replies to the message of the command.
* @param message The message to reply.
*/
reply(message: string): Promise<import("structures").BaseMessage<T>>;
/**
* Checks whether the bot is moderator in this context.
* @returns A boolean indicating whether the bot is moderator.
*/
isModerator(): Promise<boolean>;
/**
* Fetches the stream which is currently live in the context. If the stream is offline, it will return null.
*/
stream(): Promise<import("structures").Stream<T> | null>;
/**
* Checks whether the author is a moderator in the context.
*/
inStream(): Promise<boolean>;
/**
* The Id of the author of the command.
*/
get authorId(): string;
/**
* The content of the context's message. This message is parsed so it will return the message without the prefix and the command name.
*/
get content(): string;
/**
* The Id of the context's chatroom.
*/
get chatroomId(): string;
/**
* The context's broadcaster.
*/
get broadcaster(): import("structures").BaseUser<T>;
/**
* The mentions of the context's message.
*/
get mentions(): import("structures").Collection<string, import("structures").BaseUser<T>>;
/**
* The emotes of the context's message.
*/
get emotes(): import("structures").Collection<string, import("structures").BaseEmote<T, import("structures").EmoteType>>;
/**
* The cheermotes of the context's message.
*/
get cheermotes(): import("structures").Collection<string, import("structures").BaseCheermote<T>>;
/**
* The bits cheered in the context's message.
*/
get bits(): number;
/**
* Fetches channel of the context's chatroom.
*/
get channel(): import("structures").BaseChannel<T>;
}