Skip to content
← Back to Community
Why does my join message not work?
Profile icon
UkDarky

I'm trying to make it so my bot says a join message in my welcome channel, but it comes up with an error and doesnt work.
The error: Unindent does not match any outer indentation level

@bot.event
async def on_member_join(self, member):
ment = member.mention
await self.bot.get_channel(790977019940175882).send(f"{ment} has joined the server.")
print(f"{member} has joined the server.")

Voters
Profile icon
sgerherherhg
Profile icon
UkDarky
Comments
hotnewtop
Profile icon
alanchen12

@UkDaUkDarky Try going to your application in the developer dashboard, and enabling intents.
First, go to your app within the developer dashboard.

Then, go to the bot tab. bot tab

Finally, scroll down to the intents section and enable intents.
intents

If this helped, mark this as correct!

Profile icon
UkDarky

Should i enable both?
@alanchen12

Profile icon
alanchen12

If you want to, yes, but I think only server members are needed for join leave events @UkDarky

Profile icon
UkDarky

It still doesnt seem to work... maybe it's the code?
@alanchen12

Profile icon
alanchen12

Intents should solve the problem, espically since your code looks correct and you aren't getting errors. Be sure to save before you exit.
image
@UkDarky

Profile icon
RYANTADIPARTHI

uh, there seems to be no error.

Profile icon
UkDarky

Yeah the error was fixed but it just doesnt work
@RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@UkDarky it says im alive

Profile icon
UkDarky
Profile icon
RYANTADIPARTHI

@UkDarky the output

Profile icon
UkDarky

So? That's to keep the bot running @RYANTADIPARTHI

Profile icon
SixBeeps

Error is exactly what it says. Line 26 is indented with a tab, but 27 and 28 are indented with two spaces. Python hates this, so you need to change then to match each other.

Profile icon
UkDarky

Thanks! Now there isn't an error but the join message is still broken. Any idea on how to make it work?
@SixBeeps

Profile icon
SixBeeps

@UkDarky Does it not do anything?

Profile icon
alanchen12

If it still does not work, try enabling intents in the developer dashboard. @UkDarky

Profile icon
UkDarky

Where are intents in the developer dashboard?
@alanchen12

Profile icon
SixBeeps

@UkDarky This thing I think?
image

EDIT: Nope, I'm wrong. Gotta read what other people say first...