#Tracking whatever a guildMember has boosted the server more than once
1 messages · Page 1 of 1 (latest)
Sure thank-you
- Do you expect it to track a single guild member's or it be a global feature of your bot?
Please let me know my options for both cases
- What services do you already have with your bot? Do you already store some guildMembers on a database?
I don't really do much, there's no permanent storage more like a volatile storage, as soon as the work is done the data is deleted
Well, I use discord-ts and I can already listen to those events 
which tells me that implementing this should be easy. Let me inspect their repo
Okay 🥶
Now, to track the amounts of boost they have done, you will have to run callbacks which update either a storage on some server, or some file on yours. Your data structure (and the sideeffects you want to run on discord with your client) depends on whatever you wanna do it for a guild or for every guild your bot is; a basic one could be guilds/{guildId}/{memberId}, where each {memberId} is a json that is readed and modified when necessary
Makes sense so you're saying I count the number of occurrences instead of letting the API do the work?
Yeah, every time your condition for checking if they have boosted the server is ran, +1 a count on your file, and if that count is equal to any amount you want, you do your side effects on that guild
and when they unboost you just -1
mmm oka makes sense yet the issue is the history, i don't know if they're gonna boost tomorrow and their first boost was idk 80 days ago or something
I already applied the tactic you mentioned for server votes not a bad idea yet the history of votes / boosts remains the main issue in this case 
include any structure that suits you the most to store their history at their files
i.e, a map that is mapped by 'first', 'second', 'third', and points to timestamps
I didn't quite catch that
a sample {memberId} file could be like this:
{
timesBoosted: number,
history: Map(size) {
first: <Date> of whenever timesBoosted was first modified
...
}
}
You could also do it with just a sample array and assume that you added each item on it's correct order
and now, if you were referring to having a reference to them having boosted prior to you tracking their guild, you can't really do
your guildMemberUpdate could initiate their status even if the event is not relevant to a new boost
The issue is how do I get the Date
This
premiumSince is the time stored as milliseconds

You can do it as soon as any guildMemberUpdate relevant to that user is fired
True
Mhm mhm makes sense and my brain hurts too I'm sorry been through hell today lmao
Thankyou so much for your help I have a clearer picture now at least