AsyaTheAbove / is-kate-asleep

Adds a command called sleepstatus that checks if katlyn#9607 is active. This uses scary hax so it can break overnight.
MIT License
2 stars 1 forks source link

About using the avatar url... #1

Open Sans3108 opened 3 years ago

Sans3108 commented 3 years ago

Hi, I tinkered around thinking why you would go after her avatar instead of her ID, and I realized the ID is not present in a member object :(

But I was thinking, can't you check if they username and discrim match? I think most people on discord are not going to change that too often... seems more safe to me

BenSegal855 commented 3 years ago

The discrim is logged as all 0's for everyone so thats out and the username field is actually their nickname on that server which will probably change more than the avatar. This still isnt the best system but its probably as good as you can get with just the widget api.

Sans3108 commented 3 years ago

The discrim is logged as all 0's for everyone so thats out and the username field is actually their nickname on that server which will probably change more than the avatar. This still isnt the best system but its probably as good as you can get with just the widget api.

Ah, yea I agree. I thought that was the username, and I noticed it's all 0's, but I already posted the previous comment... Isn't there something else we can use?

AsyaTheAbove commented 3 years ago

Isn't there something else we can use?

There are two other ways I know of.

Bots that share guilds with people can get presence (online, dnd, playing status) information about a user. So if we could get Kate (and others) in a server with a bot, or just add this functionality to Powercord (The bot, to be honest this is not a functionality that is worth adding to the bot).

Or, like ezist#7571 suggested, if someone that is more into Discord internals than I am helps us, we could first check if the user shares guilds with those cool people and then check their presence that way, with avatar_url and nickname checks as fallback.

Or, as a third way, we could improve the current system (checking via widget API). I looked deeper into the API and realised that members have an ID key. I quickly realised the API returns members sorted alphabetically, which means if we can get Kate (and others) into a server with their nicknames single characters (like A for Kate, B for Emma, C for Ben, etc.) we can get the members list in the same order every time. So we could members[0] and get Kate, for example.

Pinning this issue as this is the most important (haha it is the only one) issue.