Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No worked event "on_member_join" and "on_member_remove" #6041

Closed
l1we4 opened this issue Nov 14, 2020 · 9 comments
Closed

No worked event "on_member_join" and "on_member_remove" #6041

l1we4 opened this issue Nov 14, 2020 · 9 comments
Labels
intents related User provided bad/invalid intents invalid This is not right.

Comments

@l1we4
Copy link

l1we4 commented Nov 14, 2020

Summary

I'm trying to get information from event

Summary

Reproduction Steps

@client.event
async def on_member_join(mem)
print(mem)

Expected Results

info for user

Actual Results

nothing

Intents

event

Checklist

  • [ x] I have searched the open issues for duplicates.
  • [ x] I have shown the entire traceback, if possible.
  • [ x] I have removed my token from display, if visible.
  • [ x] I have provided the intents that my bot is using.
@l1we4 l1we4 added the bug This is a bug with the library. label Nov 14, 2020
@SebbyLaw
Copy link
Contributor

Duplicate of #5867

@ghost
Copy link

ghost commented Nov 15, 2020

You enable intents? if no, why you openned issue? ban on google?

@ghost
Copy link

ghost commented Nov 15, 2020

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}!')

@l1we4
Copy link
Author

l1we4 commented Nov 15, 2020

You enable intents? if no, why you openned issue? ban on google?

would have been written in Google, did not ask

@NESTOWL
Copy link

NESTOWL commented Nov 15, 2020

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!

@Rapptz
Copy link
Owner

Rapptz commented Nov 15, 2020

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’d my members go?" section in the documentation.

@Rapptz Rapptz closed this as completed Nov 15, 2020
@Rapptz Rapptz added intents related User provided bad/invalid intents invalid This is not right. and removed bug This is a bug with the library. labels Nov 15, 2020
@NESTOWL
Copy link

NESTOWL commented Nov 15, 2020

@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)

@Rapptz
Copy link
Owner

Rapptz commented Nov 15, 2020

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.

@NESTOWL
Copy link

NESTOWL commented Nov 15, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intents related User provided bad/invalid intents invalid This is not right.
Projects
None yet
Development

No branches or pull requests

4 participants