Reputation: 1
So I am making a welcome command that looks as follows:
@client.event
async def on_member_join(self, *, member: discord.Member):
meant = member.mention
member = discord.Guild.member
guild = discord.Guild
welcomz = [
', welcome to the server!',
' joined the party!',
' came just for the cake.',
', everyone welcomes you to the server!',
', go do some stuff here.',
', so you do know how an invite link works!',
', took you long enough!',
]
try:
await self.client.get_channel(guild.text_channel.id).send(f"{meant}" + random.choice(welcomz))
except:
print(f"Error occurred when welcoming member:{meant}")
and it comes up with the error. I am not totally sure what is wrong.
Upvotes: 0
Views: 103
Reputation: 2041
Please take a look at the discord.py
documentation. The on_member_join()
event only takes one parameter and it's member
.
@client.event
async def on_member_join(member):
channel = client.get_channel(730064641857683581) # ID for your welcome channel.
welcomz = [
', welcome to the server!',
' joined the party!',
' came just for the cake.',
', everyone welcomes you to the server!',
', go do some stuff here.',
', so you do know how an invite link works!',
', took you long enough!',
]
try:
await channel.send(f"{member.mention}, {random.choice(welcomz)}")
except:
print(f"Error occurred when welcoming member: {member}")
Upvotes: 1