TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Api.Helix.Chat Class Reference

Chat related APIs More...

Inheritance diagram for TwitchLib.Api.Helix.Chat:
TwitchLib.Api.Core.ApiBase

Public Member Functions

 Chat (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
Task< GetChannelChatBadgesResponseGetChannelChatBadgesAsync (string broadcasterId, string accessToken=null)
 Gets a list of custom chat badges that can be used in chat for the specified channel. This includes subscriber badges and Bit badges. More...
 
Task< GetGlobalChatBadgesResponseGetGlobalChatBadgesAsync (string accessToken=null)
 Gets a list of chat badges that can be used in chat for any channel. More...
 
Task< GetChattersResponseGetChattersAsync (string broadcasterId, string moderatorId, int first=100, string after=null, string accessToken=null)
 [BETA] - Gets the list of users that are connected to the specified broadcaster’s chat session. More...
 
Task< GetChannelEmotesResponseGetChannelEmotesAsync (string broadcasterId, string accessToken=null)
 Gets all emotes that the specified Twitch channel created. More...
 
Task< GetEmoteSetsResponseGetEmoteSetsAsync (List< string > emoteSetIds, string accessToken=null)
 Gets emotes for one or more specified emote sets. More...
 
Task< GetGlobalEmotesResponseGetGlobalEmotesAsync (string accessToken=null)
 Gets all global emotes. Global emotes are Twitch-created emoticons that users can use in any Twitch chat. More...
 
Task< GetChatSettingsResponseGetChatSettingsAsync (string broadcasterId, string moderatorId, string accessToken=null)
 Gets the broadcaster’s chat settings. More...
 
Task< UpdateChatSettingsResponseUpdateChatSettingsAsync (string broadcasterId, string moderatorId, ChatSettings settings, string accessToken=null)
 Updates the broadcaster’s chat settings. More...
 
Task SendChatAnnouncementAsync (string broadcasterId, string moderatorId, string message, AnnouncementColors color=null, string accessToken=null)
 Sends an announcement to the broadcaster’s chat room. Requires a user access token that includes the moderator:manage:announcements scope. The ID in the moderator_id query parameter must match the user ID in the access token. More...
 
Task UpdateUserChatColorAsync (string userId, UserColors color, string accessToken=null)
 Updates the color used for the user’s name in chat from a selection of available colors. More...
 
Task UpdateUserChatColorAsync (string userId, string colorHex, string accessToken=null)
 Updates the color used for the user’s name in chat from a HEX Code. More...
 
Task< GetUserChatColorResponseGetUserChatColorAsync (List< string > userIds, string accessToken=null)
 Gets the color used for the user(s)’s name in chat. More...
 
- Public Member Functions inherited from TwitchLib.Api.Core.ApiBase
 ApiBase (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
async ValueTask< string > GetAccessTokenAsync (string accessToken=null)
 

Additional Inherited Members

- Protected Member Functions inherited from TwitchLib.Api.Core.ApiBase
async Task< string > TwitchGetAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchGetGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPatchGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPatchAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchDeleteAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericModelAsync< T > (string resource, ApiVersion api, RequestModel model, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchDeleteGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPutGenericAsync< T > (string resource, ApiVersion api, string payload=null, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPutAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchPostAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
Task PutBytesAsync (string url, byte[] payload)
 
async Task< T > GetGenericAsync< T > (string url, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, ApiVersion api=ApiVersion.Helix, string clientId=null)
 
- Protected Attributes inherited from TwitchLib.Api.Core.ApiBase
readonly IApiSettings Settings
 

Detailed Description

Chat related APIs

Constructor & Destructor Documentation

◆ Chat()

TwitchLib.Api.Helix.Chat.Chat ( IApiSettings  settings,
IRateLimiter  rateLimiter,
IHttpCallHandler  http 
)

Member Function Documentation

◆ GetChannelChatBadgesAsync()

Task< GetChannelChatBadgesResponse > TwitchLib.Api.Helix.Chat.GetChannelChatBadgesAsync ( string  broadcasterId,
string  accessToken = null 
)

Gets a list of custom chat badges that can be used in chat for the specified channel. This includes subscriber badges and Bit badges.

Parameters
broadcasterIdThe ID of the broadcaster whose chat badges you want to get.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetChannelEmotesAsync()

Task< GetChannelEmotesResponse > TwitchLib.Api.Helix.Chat.GetChannelEmotesAsync ( string  broadcasterId,
string  accessToken = null 
)

Gets all emotes that the specified Twitch channel created.

Parameters
broadcasterIdID of the broadcaster to get the emotes from.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetChatSettingsAsync()

Task< GetChatSettingsResponse > TwitchLib.Api.Helix.Chat.GetChatSettingsAsync ( string  broadcasterId,
string  moderatorId,
string  accessToken = null 
)

Gets the broadcaster’s chat settings.

To include the non_moderator_chat_delay or non_moderator_chat_delay_duration settings in the response, you must specify a User access token with scope set to moderator:read:chat_settings.

Parameters
broadcasterIdThe ID of the broadcaster whose chat settings you want to get.
moderatorIdRequired only to access the non_moderator_chat_delay or non_moderator_chat_delay_duration settings.

The ID of a user that has permission to moderate the broadcaster’s chat room. This ID must match the user ID associated with the user OAuth token.

If the broadcaster wants to get their own settings (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ GetChattersAsync()

Task< GetChattersResponse > TwitchLib.Api.Helix.Chat.GetChattersAsync ( string  broadcasterId,
string  moderatorId,
int  first = 100,
string  after = null,
string  accessToken = null 
)

[BETA] - Gets the list of users that are connected to the specified broadcaster’s chat session.

Note that there is a delay between when users join and leave a chat and when the list is updated accordingly.

Requires a user access token that includes the moderator:read:chatters scope.

Parameters
broadcasterIdThe ID of the broadcaster whose list of chatters you want to get.
moderatorIdThe ID of the moderator or the specified broadcaster that’s requesting the list of chatters.

This ID must match the user ID associated with the user access token.

Parameters
firstThe maximum number of items to return per page in the response.

The minimum page size is 1 item per page and the maximum is 1,000. The default is 100.

Parameters
afterThe cursor used to get the next page of results. The Pagination object in the response contains the cursor’s value.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ GetEmoteSetsAsync()

Task< GetEmoteSetsResponse > TwitchLib.Api.Helix.Chat.GetEmoteSetsAsync ( List< string >  emoteSetIds,
string  accessToken = null 
)

Gets emotes for one or more specified emote sets.

An emote set groups emotes that have a similar context.

For example, Twitch places all the subscriber emotes that a broadcaster uploads for their channel in the same emote set.

Parameters
emoteSetIdsAn ID that identifies the emote set

You may specify a maximum of 25 IDs.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetGlobalChatBadgesAsync()

Task< GetGlobalChatBadgesResponse > TwitchLib.Api.Helix.Chat.GetGlobalChatBadgesAsync ( string  accessToken = null)

Gets a list of chat badges that can be used in chat for any channel.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetGlobalEmotesAsync()

Task< GetGlobalEmotesResponse > TwitchLib.Api.Helix.Chat.GetGlobalEmotesAsync ( string  accessToken = null)

Gets all global emotes. Global emotes are Twitch-created emoticons that users can use in any Twitch chat.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetUserChatColorAsync()

Task< GetUserChatColorResponse > TwitchLib.Api.Helix.Chat.GetUserChatColorAsync ( List< string >  userIds,
string  accessToken = null 
)

Gets the color used for the user(s)’s name in chat.

Parameters
userIdsThe ID of the users whose color you want to get.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ SendChatAnnouncementAsync()

Task TwitchLib.Api.Helix.Chat.SendChatAnnouncementAsync ( string  broadcasterId,
string  moderatorId,
string  message,
AnnouncementColors  color = null,
string  accessToken = null 
)

Sends an announcement to the broadcaster’s chat room. Requires a user access token that includes the moderator:manage:announcements scope. The ID in the moderator_id query parameter must match the user ID in the access token.

Parameters
broadcasterIdThe ID of the broadcaster that owns the chat room to send the announcement to.
moderatorIdThe ID of a user who has permission to moderate the broadcaster’s chat room. This ID must match the user ID in the OAuth token, which can be a moderator or the broadcaster.
messageThe announcement to make in the broadcaster’s chat room.
colorThe color used to highlight the announcement. Possible case-sensitive values are: blue/green/orange/purple/primary(default)
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance

◆ UpdateChatSettingsAsync()

Task< UpdateChatSettingsResponse > TwitchLib.Api.Helix.Chat.UpdateChatSettingsAsync ( string  broadcasterId,
string  moderatorId,
ChatSettings  settings,
string  accessToken = null 
)

Updates the broadcaster’s chat settings.

Requires a User access token with scope set to moderator:manage:chat_settings.

Parameters
broadcasterIdThe ID of the broadcaster whose chat settings you want to update.
moderatorIdThe ID of a user that has permission to moderate the broadcaster’s chat room.

This ID must match the user ID associated with the user OAuth token.

If the broadcaster is making the update, also set this parameter to the broadcaster’s ID.

Parameters
settings
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ UpdateUserChatColorAsync() [1/2]

Task TwitchLib.Api.Helix.Chat.UpdateUserChatColorAsync ( string  userId,
string  colorHex,
string  accessToken = null 
)

Updates the color used for the user’s name in chat from a HEX Code.

Turbo or Prime Required

Parameters
userIdThe ID of the user whose chat color you want to update.
colorHexThe color to use for the user’s name in chat in hex format.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance

◆ UpdateUserChatColorAsync() [2/2]

Task TwitchLib.Api.Helix.Chat.UpdateUserChatColorAsync ( string  userId,
UserColors  color,
string  accessToken = null 
)

Updates the color used for the user’s name in chat from a selection of available colors.

Parameters
userIdThe ID of the user whose chat color you want to update.
colorThe color to use for the user’s name in chat from UserColors selection.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance

The documentation for this class was generated from the following file: