So I looked at many sources saying that on_guild_leave
is how it is used, but I can’t get it to work. Here is my code:
JavaScript
x
15
15
1
@client.event
2
async def on_guild_join(guild): # noqa
3
try:
4
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{len(client.guilds)} Servers | !help"))
5
except Exception as e:
6
print(e)
7
8
9
@client.event
10
async def on_guild_leave(guild): # noqa
11
try:
12
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{len(client.guilds)} Servers | !help"))
13
except Exception as e:
14
print(e)
15
Can anyone seem to help?
on_guild_join
works, but on_guild_leave
doesn’t.
Advertisement
Answer
on_guild_leave
doesn’t exist, use on_guild_remove
instead. Docs for on_guild_remove