Streaks
#
Read more about the Streak system in Hiro here.
Listing streaks
#
You can list the current streaks for the user:
1
2
| const streaksList = hiroClient.streaksList(session);
console.log(streaksList);
|
1
2
| var streaksList = await hiro.streaksList(session, request)
print(streaksList)
|
Claiming Streaks Rewards
#
Players can claim streak rewards using the streaksClaim
method, passing the streak IDs.
1
2
3
4
5
| var request = Hiro.StreaksClaimRequest.new()
request.item_category = ["daily_login"]
var streaksList = await hiro.streaksClaim(session, request)
print(streaksList)
|
Resetting Streaks
#
To reset specific streaks for a player, use the streaksReset
method:
1
2
3
4
5
| var request = Hiro.StreaksResetRequest.new()
request.item_category = ["daily_login"]
var streaksList = await hiro.streaksReset(session, request)
print(streaksList)
|
Updating Streaks
#
You can manually update streaks for a player by passing a dictionary of streak names and new values:
1
2
3
4
5
6
| var request = Hiro.StreaksUpdateRequest.new()
request.ids = {
"daily_login" : "1"
};
var streaksList = await hiro.streaksUpdate(session, request)
print(streaksList)
|