Creating Emojis Discord.Py

    with open("emoji.jpg", "r") as emoji:       image = emoji.read()     await ctx.guild.create_custom_emoji(name='user', image=image, roles=None, reason=None) 

I’m trying to create a command that takes a file and makes it an emoji. I’m keep getting the error ‘charmap’ codec can’t decode byte 0x8f in position 249: character maps to ‘. emoji.jpg is in the same folder that my bot file is in. I can’t find an answer anywhere, I even check the docs but can’t find anything on how to fix this.

Add Comment
1 Answer(s)

Try this:

with open("emoji.jpg", "rb") as emoji:     image = emoji.read() await ctx.guild.create_custom_emoji(name='user', image=image, roles=None, reason=None) 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.