TwitchContext
The context of the command.
Extends
Base
<T
>
Type parameters
Type parameter | Value |
---|---|
K extends OptionsRecord | object |
T extends EventSubConnection | DefaultConnection |
Constructors
new TwitchContext()
Creates a new instance of the command context.
Parameters
Parameter | Type | Description |
---|---|---|
chatbot | ChatBot <T > | The current instance of the chatbot. |
data | MessageData <T , K > | The data of the command. |
Returns
TwitchContext
<K
, T
>
Overrides
Base<T>.constructor
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:59
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
author | readonly | Author <T > | The author of the command. | - |
chatbot | readonly | ChatBot <T > | The current instance of the chatbot. | Base.chatbot |
chatroom | readonly | ChatRoom <T > | The chatroom where the command was run. | - |
commandName | readonly | string | The name of the command. | - |
message | readonly | Message <T > | The message received when the command was run. | - |
options | readonly | CommandOptionsAux <T , K > | The options of the command. | - |
prefix | readonly | string | The prefix used to run the command. | - |
Accessors
authorId
The Id of the author of the command.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:103
bits
The bits cheered in the context’s message.
Returns
number
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:152
broadcaster
The context’s broadcaster.
Returns
BaseUser
<T
>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:124
channel
Fetches channel of the context’s chatroom.
Returns
BaseChannel
<T
>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:159
chatroomId
The Id of the context’s chatroom.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:117
cheermotes
The cheermotes of the context’s message.
Returns
Collection
<string
, BaseCheermote
<T
>>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:145
content
The content of the context’s message. This message is parsed so it will return the message without the prefix and the command name.
Returns
string
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:110
emotes
The emotes of the context’s message.
Returns
Collection
<string
, BaseEmote
<T
, EmoteType
>>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:138
mentions
The mentions of the context’s message.
Returns
Collection
<string
, BaseUser
<T
>>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:131
Methods
inStream()
Checks whether the author is a moderator in the context.
Returns
Promise
<boolean
>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:96
isModerator()
Checks whether the bot is moderator in this context.
Returns
Promise
<boolean
>
A boolean indicating whether the bot is moderator.
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:82
reply()
Replies to the message of the command.
Parameters
Parameter | Type | Description |
---|---|---|
message | string | The message to reply. |
Returns
Promise
<BaseMessage
<T
>>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:74
stream()
Fetches the stream which is currently live in the context. If the stream is offline, it will return null.
Returns
Promise
<null
| Stream
<T
>>
Source
twitchfy/packages/chatbot/src/structures/TwitchContext.ts:89