Wynncraft / WynncraftAPI

Official Wynncraft Public API (Documentation & Issue Tracker)
https://docs.wynncraft.com/
21 stars 10 forks source link

Request: API Feature (Bot) #32

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello, I've been thinking to make a discord bot for my guild that keeps count of the amount of xp/emeralds donated each week, (Which is a thing we do in our guild but we wanted to make it easier by having a bot that will keep count on that) So i decided to take a look into making a bot, i've asked motoki1 about how to get a bot to do that, which motoki responded with the link towards the forum thread of the bot API Documents.

So i wanted to Request/Suggest a feature that i dindt see implemented in the API document. That was a (weekly count) of the amount of emeralds/xp contributed to the guild per person.

ghost commented 5 years ago

Also with a weekly count i meant for example, how much xp/emeralds someone has contributed in a week, so the difference between those weeks. For example if you contributed 85000 emeralds and 100000 xp in week 1, and the next week nothing then it will also show that in week 2 that person will have 0 contributed (for that week)

colinrioux commented 5 years ago

Hey there,

According to https://docs.wynncraft.com/Guild-API/#statistics (specifically the Guild Member Object), it records how much XP has been contributed by each player. We currently do not log how many emeralds are contributed; perhaps sometime in the future we can start doing that, but no guarantee at this time.

If you want to get how much XP was contributed by Player X in 1 week, you could request the Guild API at 12:00pm on Monday Week 1, and cache (store in a db, file, etc) the amount of XP contributed by Player X. Then on 12:00pm on Monday Week 2 take the amount of XP contributed by Player X and subtract what was Player X's XP Week 1 (you just cached this data) and you should have the weekly amount of XP contributed.

Given that the overhead of doing those calculations & data quantity stored per person per guild would be pretty large, we won't be implementing such feature natively into the API / Game. However, I suggest applying the above methodology to get the results which you desire.