Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
feat(client): add auth_analytics
Browse files Browse the repository at this point in the history
Signed-off-by: hldh214 <[email protected]>
  • Loading branch information
hldh214 committed Jul 10, 2023
1 parent c629c1d commit db2ce32
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lokbot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,15 +541,28 @@ def item_list(self):
wait=tenacity.wait_fixed(1),
retry=tenacity.retry_if_exception_type(ratelimit.RateLimitException),
)
@ratelimit.limits(calls=1, period=4)
@ratelimit.limits(calls=1, period=2)
def item_use(self, code, amount=1):
"""
使用道具
:param code:
:param amount:
:return:
"""
return self.post('item/use', {'code': code, 'amount': amount})
res = self.post('item/use', {'code': code, 'amount': amount})

self.auth_analytics('item/use', f'{code}|{amount}')

return res

def auth_analytics(self, url, param):
"""
Unknown API added in 1.1660.143.221
:param url:
:param param:
:return:
"""
return self.post('auth/analytics', {'url': url, 'param': param})

@tenacity.retry(
wait=tenacity.wait_fixed(1),
Expand Down

0 comments on commit db2ce32

Please sign in to comment.