Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. function url(url: text) :: text:
  2. replace all "ยง" with "&" in {_url}
  3. replace all "ย" with "_" in {_url}
  4. return {_url}
  5.  
  6.  
  7.  
  8. every 30 seconds:
  9. 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"
  10. map json body of last http response to {_twitchpoints::*}
  11. set {_n} to 1
  12. loop 24 times:
  13. if "%{_twitchpoints::docs::%{_n}%::item::name}%" is "100 points":
  14. add 100 to {points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}
  15. set {player} to {_twitchpoints::docs::%{_n}%::input::1}
  16. broadcast "%{_twitchpoints::docs::%{_n}%::input::1}%"
  17. send "%{points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}%" to {_twitchpoints::docs::%{_n}%::input::1}
  18. 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"
  19. add 1 to {_n}
  20. else:
  21. if "%{_twitchpoints::docs::%{_n}%::item::name}%" is "200 points":
  22. add 200 to {points.uuid of %{_twitchpoints::docs::%{_n}%::input::1}%}
  23. set {_player} to {_twitchpoints::docs::%{_n}%::redeemer::username}
  24. message "%{points.uuid of %{_twitchpoints::docs::%{_n}%::redeemer::username}%}%" to {_twitchpoints::docs::%{_n}%::input::1}
  25. 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"
  26. add 1 to {_n}
  27. else:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement