twitch-commando
Version:
Twitch Bot Commando Client
59 lines (51 loc) • 1.04 kB
JavaScript
/**
* Twitch Channel object
*
* @class
*/
class TwitchChatChannel
{
/**
* Creates an instance of TwtichChatChannel.
* @param {Object} originalMessage
* @param {TwitchCommandoClient} client
* @memberof TwtichChatChannel
*/
constructor(originalMessage, client)
{
this.originalMessage = originalMessage;
this.client = client;
}
/**
* Channel name
*
* @readonly
* @memberof TwtichChatChannel
*/
get name()
{
return this.originalMessage.channel;
}
/**
* Channel ID
*
* @readonly
* @memberof TwtichChatChannel
*/
get id()
{
return this.originalMessage.room_id;
}
/**
* Send text message in the channel
*
* @async
* @param {String} text Message text
* @memberof TwtichChatChannel
*/
async say(text)
{
this.say(this.name, text);
}
}
module.exports = TwitchChatChannel;