I'm coding a discord.py discord BOT. Now I'm writing the "on_member_join", and I'm trying to get the new member profile pic to make a custom image of welcome. Here's the issue. When I start the program, and a member join the server, the request is correctly send, but I receive the HTTP Error 403: Forbidden error.
My code:
import discord
from PIL import Image,ImageDraw,ImageFont
import urllib.request
@client.event
async def on_member_join(member):
url = f"{member.avatar_url}"
name = "profile.png"
urllib.request.urlretrieve(url, name)
Remember that I need to download the image because I have to customize it with the "Pillow library"