hackmud-chat
Version:
A hackmud chat api wrapper for nodejs.
47 lines • 1.44 kB
TypeScript
/// <reference types="node" />
import { HackmudApi } from "./hackmud.api";
/**
* Represents a hackmud channel.
*/
export declare class Channel {
/**
* The users that are in this channel.
*/
users: string[];
/**
* The name of the channel
*/
name: string;
/**
* The account user related to the channel.
*
* The one that it's to send the messages from when using send(), etc.
*/
ownUser: string;
private api;
constructor(api: HackmudApi, name: string, users: string[], ownUser: string);
/**
* Send a message to the channel with ownUser
* @param msg The message
*/
send(msg: string): Promise<void>;
/**
* Send a message every x ms.
* @param msg The message
* @param interval Interval in ms
*/
sendInterval(msg: string, interval: number): NodeJS.Timer;
/**
* Sends the messages in the array in the order given separated by the specified time.
* @param msgs The messages
* @param interval Interval in ms
*/
sendIntervalSequence(msgs: string[], interval: number): NodeJS.Timer;
/**
* Every interval ms send a random message from the given array.
* @param msgs The messages
* @param interval Interval in ms
*/
sendIntervalRandom(msgs: string[], interval: number): NodeJS.Timer;
}
//# sourceMappingURL=channel.d.ts.map