#Invite logs

1 messages · Page 1 of 1 (latest)

patent mesa
#

seems that the error is coming from here invites[guild.id] = await guild.invites()

winter bronze
#

Show all the code

patent mesa
#

thats in the on_ready function ill show u the other

vestal fulcrum
#

not really needed

patent mesa
#
invites_before_join = invites[member.guild.id]
  invites_after_join = await member.guild.invites()

  for invite in invites_before_join: 
    if invite.uses < find_invite_by_code(invites_after_join, invite.code).uses:
      embed = discord.Embed(title=f"Member Joined", color=discord.Color.blurple())
      embed.add_field(name=f"Member", value=f"{member.id} - {member.mention} - {member.username}#{member.discriminator}")
      embed.add_field(name=f"Inviter", value=f"{invite.inviter.id} - {invite.inviter.mention} - {invite.inviter.username}#{invite.inviter.discriminator}")   
      embed.add_field(name=f"Invite Code", value=invite.code)
      embed.add_field(name=f"Account Creation",  value=f"<t:{int(member.created_at.timestamp())}:F>")

      await invc.send(embed=embed)
      invites[member.guild.id] = invites_after_join```
vestal fulcrum
#

you bot doesnt have perms to see that data

patent mesa
#

it has admin

vestal fulcrum
#

oh

#

full traceback please

patent mesa
#
ignoring exception in on_ready
Traceback (most recent call last):
File "/.local/lib/python3.9/site-packages/discord/client.py", line 377, in _run_event
await coro(*args, **kwargs)
File "/main.py", line 260, in on_ready
invites[guild.id] = await guild.invites()
File "/.local/lib/python3.9/site-packages/discord/guild.py", line 2401, in invites
data = await self._state.http.invites_from(self.id)
File "/.local/lib/python3.9/site-packages/discord/http.py", line 365, in request
raise Forbidden(response, data)
 discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions```
#

@vestal fulcrum

vestal fulcrum
#
  for guild in bot.guilds:
    invites[guild.id] = await guild.invites()

this will request invites for all guilds the bot is in

patent mesa
#

ohh is it cux i have the bot in multiple guilds

vestal fulcrum
#

yea

#

dont put the for loop if you only want for GUILD_ID

patent mesa
#

oh

#

so just remove for guild in bot.guilds:

vestal fulcrum
#

mhm

#

and unindent

patent mesa
#

okay, do you know how i can check if the user has been invited via a vanity?

patent mesa
#

@vestal fulcrum i get a new error:

20.03 18:53:25 [Bot] Traceback (most recent call last):
20.03 18:53:25 [Bot] File "/.local/lib/python3.9/site-packages/discord/client.py", line 377, in _run_event
20.03 18:53:25 [Bot] await coro(*args, **kwargs)
20.03 18:53:25 [Bot] File "/main.py", line 3147, in on_member_join
20.03 18:53:25 [Bot] invites_before_join = invites[member.guild.id]
20.03 18:53:25 [Bot] KeyError: 1084213227828813835```
vestal fulcrum
#

that guild id is not present in your dict pepehmm

patent mesa
#

huh?

gritty yew
blazing canyonBOT
# patent mesa huh?

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @clever glacier.

gritty yew
#

If you dont need help