Current section
Files
Jump to
Current section
Files
lib/resources/chat/get_chatters.ex
defmodule TwitchApi.Chat.GetChatters do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
Gets the list of users that are connected to the specified broadcaster’s chat room.
### requests:
curl -X GET 'https://api.twitch.tv/helix/chat/chatters?broadcaster_id=123456&moderator_id=654321'
-H'Authorization: Bearer kpvy3cjboyptmiacwr0c19hotn5s'
-H'Client-Id: hof5gwx0su6owfn0nyan9c87zr6t'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":[{"user_login":"smittysmithers"},...],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6NX19"},"total":8}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
BETA Gets the list of users that are connected to the specified broadcaster’s chat session.
### Required authentication:
### Required authorization:
Requires a user access token that includes the moderator:read:chatters scope.
"""
@typedoc """
The ID of the broadcaster whose list of chatters you want to get.
"""
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
@typedoc """
The 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.The moderator must have permission to moderate the broadcaster’s chat room.
"""
@type moderator_id :: %{required(:moderator_id) => String.t()}
@typedoc """
The 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.
"""
@type first :: %{required(:first) => integer}
@typedoc """
The cursor used to get the next page of results. The Pagination object in the response contains the cursor’s value. Read More
"""
@type after_query_param :: %{required(:after_query_param) => String.t()}
@spec call(broadcaster_id | moderator_id | first | after_query_param) ::
{:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{broadcaster_id: broadcaster_id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/chat/chatters?broadcaster_id=#{broadcaster_id}",
Headers.config_headers(),
nil
)
end
def call(%{moderator_id: moderator_id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/chat/chatters?moderator_id=#{moderator_id}",
Headers.config_headers(),
nil
)
end
def call(%{first: first}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/chat/chatters?first=#{first}",
Headers.config_headers(),
nil
)
end
def call(%{after: after_query_param}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/chat/chatters?after=#{after_query_param}",
Headers.config_headers(),
nil
)
end
end