'Discord Python Bot - Not sending user join message

Sometimes the user join message works, sometimes it doesn't. Any suggestions?

async def on_member_join(member):
    await member.send("**Welcome to 999**\n*Run 9/commands to see available commands*\n\n*VOTE US! - https://discords.com/servers/947981180068827216/upvote*\n*Discord Invite* - https://discord.gg/KD89DQngVx")
    channel = client.get_channel(947981180622471210)
    embed=discord.Embed(title="Welcome!",description=f"{member.mention} just joined!",color=0xc20af5)
    embed.set_thumbnail(url=member.avatar_url)
    await channel.send(embed=embed)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source