Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function url(url: text) :: text:
- replace all "ยง" with "&" in {_url}
- replace all "ย" with "_" in {_url}
- return {_url}
- every 30 seconds:
- send a request to url("https://api.streamelements.com/kappa/v2/store/{@id}/redemptions/search?from=2019-02-20T12:24:42.637Zยงto=3000-02-20T12:24:42.638Zยงlimit=25ยงoffset=0ยงpage=1ยงpending=trueยงsearchBy=redeemer.usernameยงsort=%%7B%%22updatedAt%%22:-1%%7D") with the headers "Authorization: Bearer {@Authorization}" , "accept: application/json" and "content-type: Content-Type"
- map json body of last http response to {_twitchpoints::*}
- set {_n} to 1
- loop 24 times:
- if "%{_twitchpoints::docs::%{_n}%::item::name}%" is "100 points":
- add 100 to {points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}
- set {player} to {_twitchpoints::docs::%{_n}%::input::1}
- broadcast "%{_twitchpoints::docs::%{_n}%::input::1}%"
- send "%{points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}%" to {_twitchpoints::docs::%{_n}%::input::1}
- send a "DELETE" request to url("https://api.streamelements.com/kappa/v2/store/{@id}/redemptions/%{_twitchpoints::docs::%{_n}%::_id}%") with the headers "Authorization: Bearer {@Authorization}" , "accept: application/json" and "content-type: Content-Type"
- add 1 to {_n}
- else:
- if "%{_twitchpoints::docs::%{_n}%::item::name}%" is "200 points":
- add 200 to {points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}
- set {_player} to {_twitchpoints::docs::%{_n}%::redeemer::username}
- message "%{points.uuid of %{_twitchpoints::docs::%{_n}%::redeemer::username}%}%" to {_twitchpoints::docs::%{_n}%::input::1}
- send a "DELETE" request to url("https://api.streamelements.com/kappa/v2/store/{@id}/redemptions/%{_twitchpoints::docs::%{_n}%::_id}%") with the headers "Authorization: Bearer {@Authorization}" , "accept: application/json" and "content-type: Content-Type"
- add 1 to {_n}
- else:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement