0.2.3: Fix subage information
This commit is contained in:
parent
5ba089cc72
commit
fc2957a601
2 changed files with 36 additions and 41 deletions
|
@ -27,6 +27,14 @@ module TwAPI::Datahandlers::Twitch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private macro isBanned2(gql, mode)
|
||||||
|
if {{gql}}["userResultBy#{{mode}}"]["reason"]?
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def user(env)
|
def user(env)
|
||||||
mode = env.params.query.has_key?("id") ? "ID" : "Login"
|
mode = env.params.query.has_key?("id") ? "ID" : "Login"
|
||||||
|
|
||||||
|
@ -391,7 +399,7 @@ module TwAPI::Datahandlers::Twitch
|
||||||
json.field "daysRemaining", gql["info"]["relationship"]["streak"]["daysRemaining"]?
|
json.field "daysRemaining", gql["info"]["relationship"]["streak"]["daysRemaining"]?
|
||||||
json.field "months", gql["info"]["relationship"]["streak"]["months"]?
|
json.field "months", gql["info"]["relationship"]["streak"]["months"]?
|
||||||
json.field "end", gql["info"]["relationship"]["streak"]["end"]?
|
json.field "end", gql["info"]["relationship"]["streak"]["end"]?
|
||||||
json.field "start", gql["info"]["relationship"]["streak"]["elapsedDays"]?
|
json.field "start", gql["info"]["relationship"]["streak"]["start"]?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -404,7 +412,7 @@ module TwAPI::Datahandlers::Twitch
|
||||||
json.field "daysRemaining", gql["info"]["relationship"]["cumulative"]["daysRemaining"]?
|
json.field "daysRemaining", gql["info"]["relationship"]["cumulative"]["daysRemaining"]?
|
||||||
json.field "months", gql["info"]["relationship"]["cumulative"]["months"]?
|
json.field "months", gql["info"]["relationship"]["cumulative"]["months"]?
|
||||||
json.field "end", gql["info"]["relationship"]["cumulative"]["end"]?
|
json.field "end", gql["info"]["relationship"]["cumulative"]["end"]?
|
||||||
json.field "start", gql["info"]["relationship"]["cumulative"]["elapsedDays"]?
|
json.field "start", gql["info"]["relationship"]["cumulative"]["start"]?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -413,8 +421,14 @@ module TwAPI::Datahandlers::Twitch
|
||||||
else
|
else
|
||||||
json.field "meta" do
|
json.field "meta" do
|
||||||
json.object do
|
json.object do
|
||||||
json.field "type", nil # TODO: get the type of the sub, could be paid or something else gql["info"]["relationship"]["meta"][""]
|
if json.field "type", gql["info"]["relationship"]["meta"]["giftMeta"]["isGift"] == false
|
||||||
json.field "tier", (gql["info"]["relationship"]["meta"]["tier"].to_s.to_i / 1000)
|
json.field "type", "paid"
|
||||||
|
elsif gql["info"]["relationship"]["meta"]["purchasedWithPrime"] == true
|
||||||
|
json.field "type", "prime"
|
||||||
|
else
|
||||||
|
json.field "type", "gift"
|
||||||
|
end
|
||||||
|
json.field "tier", (gql["info"]["relationship"]["meta"]["tier"].to_s.to_i // 1000)
|
||||||
json.field "endsAt", gql["info"]["relationship"]["meta"]["endsAt"]
|
json.field "endsAt", gql["info"]["relationship"]["meta"]["endsAt"]
|
||||||
json.field "renewsAt", gql["info"]["relationship"]["meta"]["renewsAt"]
|
json.field "renewsAt", gql["info"]["relationship"]["meta"]["renewsAt"]
|
||||||
json.field "giftMeta", nil # TODO: fill giftMeta is sub is gifted
|
json.field "giftMeta", nil # TODO: fill giftMeta is sub is gifted
|
||||||
|
|
|
@ -30,33 +30,23 @@ module TwAPI::TwitchAPI::GQL
|
||||||
emoticonPrefix { name }
|
emoticonPrefix { name }
|
||||||
panels(hideExtensions: false) { id type }
|
panels(hideExtensions: false) { id type }
|
||||||
followers { totalCount }
|
followers { totalCount }
|
||||||
roles {
|
roles { isStaff isAffiliate isPartner isExtensionsDeveloper }
|
||||||
isStaff
|
displayBadges { setID title description version }
|
||||||
isAffiliate
|
|
||||||
isPartner
|
|
||||||
isExtensionsDeveloper
|
|
||||||
}
|
|
||||||
displayBadges {
|
|
||||||
setID
|
|
||||||
title
|
|
||||||
description
|
|
||||||
version
|
|
||||||
}
|
|
||||||
chatSettings {
|
chatSettings {
|
||||||
autoModLevel
|
autoModLevel
|
||||||
blockLinks
|
blockLinks
|
||||||
chatDelayMs
|
chatDelayMs
|
||||||
followersOnlyDurationMinutes
|
followersOnlyDurationMinutes
|
||||||
isBroadcasterLanguageModeEnabled
|
isBroadcasterLanguageModeEnabled
|
||||||
isEmoteOnlyModeEnabled
|
isEmoteOnlyModeEnabled
|
||||||
isFastSubsModeEnabled
|
isFastSubsModeEnabled
|
||||||
isOptedOutOfGlobalBannedWordsList
|
isOptedOutOfGlobalBannedWordsList
|
||||||
isSubscribersOnlyModeEnabled
|
isSubscribersOnlyModeEnabled
|
||||||
isUniqueChatModeEnabled
|
isUniqueChatModeEnabled
|
||||||
requireVerifiedAccount
|
requireVerifiedAccount
|
||||||
rules
|
rules
|
||||||
slowModeDurationSeconds
|
slowModeDurationSeconds
|
||||||
}
|
}
|
||||||
stream {
|
stream {
|
||||||
averageFPS
|
averageFPS
|
||||||
bitrate
|
bitrate
|
||||||
|
@ -69,18 +59,9 @@ module TwAPI::TwitchAPI::GQL
|
||||||
type
|
type
|
||||||
game{displayName}
|
game{displayName}
|
||||||
}
|
}
|
||||||
lastBroadcast {
|
lastBroadcast { game{displayName} id startedAt title }
|
||||||
game{displayName}
|
|
||||||
id
|
|
||||||
startedAt
|
|
||||||
title
|
|
||||||
}
|
|
||||||
channel {
|
channel {
|
||||||
chatters {
|
chatters { count moderators {login} vips {login} }
|
||||||
count
|
|
||||||
moderators { login }
|
|
||||||
vips { login }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue