#Is it possible to get the join method of a user when he joins?

1 messages · Page 1 of 1 (latest)

next mulch
#

Hey there, i'm trying to make an invite tracker and I need to get the join method of everyone who joins my server.

#

@little haven Do you know maybe?

little haven
next mulch
#

Like the join method

little haven
#

there's an api endpoint that discord provides for the members list

#

it's hidden though

#

ill show you it

next mulch
#

Wait I don't understand

#

What you meant

little haven
#

Discord API

next mulch
#

Yeah?

#

Ohhh

little haven
#

there's an endpoint to fetch the members list with all the data

next mulch
next mulch
little haven
#
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

next mulch
little haven
#

print the response and you'll see the data

next mulch
next mulch
#

Oh so just paste that inside my class

little haven
#

yes

#

preferably in a function ofc

next mulch
#

Could you check out my code and tell me where I should put it?

#

its not long

little haven
#

you should know where

#

I don't know where you want to put it

next mulch
#

For now I just want to print the output

#

So il just put it at the end

little haven
#

for what command

#

sure

little haven
next mulch
#

This should work right?

little haven
#

thats why i said to print

next mulch
#

Oh alr

#

Ye theres like 3k members

little haven
#

also you would have to set it as a string as nextcord doesnt convert other types to string anymore

next mulch
#

this wont work?

little haven
#

if you still want to send it as a message, do str(response) instead of just response

#

or print

#

yeah

next mulch
#

Okay im restarting the bot

little haven
#

it's gonna output a chunk of characters, so i suggest using pprint if you want better readability

next mulch
#

Oh i did print(str(response)) lol

next mulch
little haven
#

that works yea

#

idk why you want to set it as a string in print, but sure

next mulch
#

Holy that is a lot of output

little haven
#

exactly

next mulch
#

I think I saw the join method

#

of someone

little haven
#

if that was sent as a message in the server, it wouldve gotten an error hitting the character limit

next mulch
#

So thats good

little haven
next mulch
#

Found it

#

'source_invite_code': '9nGjb2YJ'

#

I just need to grab that

#

right?

little haven
#

yea

next mulch
#

W tysm