#Is it possible to get the join method of a user when he joins?
1 messages · Page 1 of 1 (latest)
as in which invites they joined from?
there's an api endpoint that discord provides for the members list
it's hidden though
ill show you it
Discord API
there's an endpoint to fetch the members list with all the data
So including the join method
Wait how do I use that tho
response = await self.bot.http.request(nextcord.http.Route("POST", f"/guilds/{interaction.guild.id}/members-search"), json={})```
I'm not sure if it works for bots anymore, but it's worth a try
Where should I put this?
In my main file or inside my cog
put it in where you do all of the invites and all that
print the response and you'll see the data
Could you please like show me a tiny script on how I should put it in? I have no idea how cuz I have never worked with api before sorry
that's the whole thing
Oh so just paste that inside my class
Could you check out my code and tell me where I should put it?
its not long
wait wdym at the end
that's most likely gonna be over the character limit if there are lots of members in the server
thats why i said to print
also you would have to set it as a string as nextcord doesnt convert other types to string anymore
Wait how else should I do it
this wont work?
if you still want to send it as a message, do str(response) instead of just response
or print
yeah
Okay im restarting the bot
this should be fine
it's gonna output a chunk of characters, so i suggest using pprint if you want better readability
Oh i did print(str(response)) lol
is that okay?
Holy that is a lot of output
exactly
if that was sent as a message in the server, it wouldve gotten an error hitting the character limit
So thats good
ye
take a look at this if you want better readability on ur data when printing
https://pypi.org/project/pprintpp/
yea
W tysm