BlushyFace.Twitch
BlushyFace.Twitch.API.Kraken.Endpoints.Users Class Reference

Partially implemented. Most methods done but need to add response objects + pagination. More...

Public Member Functions

 Users (HttpHandler httpHandler)
 https://dev.twitch.tv/docs/v5/reference/users More...
 
async Task< UserResponse > GetUser ()
 
async Task< UserResponse > GetUserById (int userId)
 
async Task< UsersResponse > GetUsers (string name)
 
async Task< UserEmoteResponse > GetUserEmotes (int userId)
 
async Task< object > CheckUserSubscriptionByChannel (int userId, int channelId)
 
async Task< object > GetUserFollows (int userId, List< KeyValuePair< string, string >> parameters=null)
 
async Task< object > CheckUserFollowsByChannel (int userId, int channelId)
 
async Task< object > FollowChannel (int userId, int channelId)
 
async Task< object > UnFollowChannel (int userId, int channelId)
 
async Task< object > GetUserBlockList (int userId)
 
async Task< object > BlockUser (int userId, int userIdToBlock)
 
async Task< object > UnblockUser (int userId, int userIdToBlock)
 

Detailed Description

Partially implemented. Most methods done but need to add response objects + pagination.

Constructor & Destructor Documentation

◆ Users()

BlushyFace.Twitch.API.Kraken.Endpoints.Users.Users ( HttpHandler  httpHandler)
inline

https://dev.twitch.tv/docs/v5/reference/users

Note: Heartbeat Service not implemented

Member Function Documentation

◆ BlockUser()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.BlockUser ( int  userId,
int  userIdToBlock 
)
inline

Blocks a user; that is, adds a specified target user to the blocks list of a specified source user.

Required scope: user_blocks_edit

Parameters
userId
userIdToBlock
Returns

◆ CheckUserFollowsByChannel()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.CheckUserFollowsByChannel ( int  userId,
int  channelId 
)
inline

Checks if a specified user follows a specified channel. If the user is following the channel, a follow object is returned.

Parameters
userId
channelId

◆ CheckUserSubscriptionByChannel()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.CheckUserSubscriptionByChannel ( int  userId,
int  channelId 
)
inline

Checks if a specified user is subscribed to a specified channel.

There is an error response (422 Unprocessable Entity) if the channel does not have a subscription program.

Scope(s) required: user_subscriptions

Parameters
userId
channelId
Returns

◆ FollowChannel()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.FollowChannel ( int  userId,
int  channelId 
)
inline

Adds a specified user to the followers of a specified channel.

There is an error response (422 Unprocessable Entity) if the channel could not be followed.

Required scope: user_follows_edit

notifications - If true, the user gets email or push notifications (depending on the user’s notification settings) when the channel goes live. Default: false.

Parameters
userId
channelId
Returns

◆ GetUser()

async Task<UserResponse> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUser ( )
inline

Gets a user object based on the OAuth token provided.

Get User returns more data than Get User by ID, because Get User is privileged.

Required scope: user_read

Returns

◆ GetUserBlockList()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUserBlockList ( int  userId)
inline

Gets a specified user’s block list. List sorted by recency, newest first.

Required scope: user_blocks_read

Parameters
userId
Returns

◆ GetUserById()

async Task<UserResponse> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUserById ( int  userId)
inline

Gets a specified user object.

Parameters
userId
returnType
Returns

◆ GetUserEmotes()

async Task<UserEmoteResponse> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUserEmotes ( int  userId)
inline

Gets a list of the emojis and emoticons that the specified user can use in chat. These are both the globally available ones and the channel-specific ones (which can be accessed by any user subscribed to the channel).

Scope(s) required: user_subscriptions

More info: https://dev.twitch.tv/docs/v5/reference/users#get-user-emotes

Parameters
userId
Returns

◆ GetUserFollows()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUserFollows ( int  userId,
List< KeyValuePair< string, string >>  parameters = null 
)
inline

Gets a list of all channels followed by a specified user, sorted by the date when they started following each channel.

Optional parameters:

limit - Maximum number of most-recent objects to return. Default: 25. Maximum: 100.

offset - Object offset for pagination of results. Default: 0.

direction - Sorting direction. Valid values: asc, desc. Default: desc (newest first).

sortby - Sorting key. Valid values: created_at, last_broadcast, login. Default: created_at.

Parameters
userId
parametersadd optional parameters here
Returns

◆ GetUsers()

async Task<UsersResponse> BlushyFace.Twitch.API.Kraken.Endpoints.Users.GetUsers ( string  name)
inline

Gets the user objects for the specified Twitch login names (up to 100).

If a specified user’s Twitch-registered email address is not verified, null is returned for that user.

Required scope: user_read

More info: https://dev.twitch.tv/docs/v5/reference/users#get-users

Parameters
name
Returns

◆ UnblockUser()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.UnblockUser ( int  userId,
int  userIdToBlock 
)
inline

Unblocks a user; that is, deletes a specified target user from the blocks list of a specified source user.

There is an error if the target user is not on the source user’s block list (404 Not Found) or the delete failed (422 Unprocessable Entity).

Required scope: user_blocks_edit

Parameters
userId
userIdToBlock
Returns

◆ UnFollowChannel()

async Task<object> BlushyFace.Twitch.API.Kraken.Endpoints.Users.UnFollowChannel ( int  userId,
int  channelId 
)
inline

Deletes a specified user from the followers of a specified channel.

Required scope: user_follows_edit

Parameters
userId
channelId