I'm creating my discord bot in discord.py and came across this one problem that I've been trying to solve. I want my bot to make a custom welcome to whomever joins the server. My code so far:
@client.event
async def on_member_join(ctx, member):
id = client.get_guild(x)
general = client.get_channel(x)
if discord.on_member_join:
general.send(f"{member.mention} has joined the server!")
VS code is giving me an error at discord saying: Module 'discord' has no 'on_member_join' memberpylint(no-member)
Two questions:
- How do I achieve what I initially wanted - sending the message in the channel that I've obtained the ID of?
- Why does it give me that error (for my better understanding)?
PS: Hidden the client ID's just to be safe, dunno if it matters, but better safe than sorry! And I'm also new to discord.py