I'm trying to get information from event
@client.event
async def on_member_join(mem)
print(mem)
info for user
nothing
event
Duplicate of #5867
You enable intents? if no, why you openned issue? ban on google?
Also, are you use code that you provided? if ye, it is will not working of course. Use this:
@client.event
async def on_member_join(member):
print(f'{member} has appeared on guild {member.guild}!')
You enable intents? if no, why you openned issue? ban on google?
would have been written in Google, did not ask
I confirm that after a long-term operation of the bot, this event stops working, only restarting the bot helps.
Although everything was good before!
Discord recently released a mandatory update to their gateway requiring the usage of gateway intents. You can find documentation on this here.
Member related events will no longer work due to this change by default. Since these are privileged intents you need to both enable it in your portal and in your code. For more info see the "Where鈥檇 my members go?" section in the documentation.
@Rapptz all intentions included!
after a long-term operation of the bot, this event stops working, only restarting the bot helps.
The only solution that I could come up with was to use the on_message event and check the log channel for the start in it discord.MessageType.new_member
and in that case every new user will be processed.
here's an example:
async def on_message(message):
if message.type is discord.MessageType.new_member and message.guild.id == SERVER_ID:
embed = discord.Embed(description=f'Hello {message.author.mention} !!!')
log_channel = message.guild.get_channel(CHANNEL_LOG_ID)
await log_channel.send(embed=embed)
If you truly believe you have an issue for this (it's unlikely for this to happen, short of discord not firing the event which is either 1) a bug on Discord's end, 2) you don't have the intent enabled, or 3) the guild intents is not enabled) then feel free to open your own issue. However note what I mentioned.
Good. Thanks!
I'll create a separate test bot a little later with only one on_member_join event
And I'll leave it working for a few days, if this behavior repeats, then I will open own an issue