Current section

Files

Jump to
scrapped_twitch_api lib resources moderation check_automod_status.ex
Raw

lib/resources/moderation/check_automod_status.ex

defmodule TwitchApi.Moderation.CheckAutoModStatus do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
Checks to see if the messages “Hello World!” and “Boooooo!” meets AutoMod requirements.
### requests:
curl -X POST 'https://api.twitch.tv/helix/moderation/enforcements/status'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
-d'{
"data": [
{
"msg_id": "123",
"msg_text": "Hello World!",
"user_id": "23749"
},
{
"msg_id": "393",
"msg_text": "Boooooo!",
"user_id": "23422"
}
]
}'
## Example response from twitch api docs:
### descriptions:
Shows that message ID 123 meets the requirements and message ID 393 does not.
### responses:
{"data":[{"msg_id":"123","is_permitted":true},{"msg_id":"393","is_permitted":false}]}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Determines whether a string message meets the channel’s AutoMod requirements.
### Required authentication:
### Required authorization:
OAuth token requiredRequired Scope: moderation:read
"""
# Provided broadcaster_id must match the user_id in the auth token.
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
# Map containing the user needed information for the user OAuth access token fetch
@type user_info :: %{user_id: integer | binary} | %{user_name: binary}
@spec call(broadcaster_id, user_info) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{broadcaster_id: broadcaster_id}, user_info) do
MyFinch.request(
"POST",
"https://api.twitch.tv/helix/moderation/enforcements/status?broadcaster_id=#{broadcaster_id}",
Headers.config_oauth_headers(user_info),
nil
)
end
end