Skip to content

Instantly share code, notes, and snippets.

View drapespy's full-sized avatar
🐢
@CarlGroth is daddy

drapes drapespy

🐢
@CarlGroth is daddy
View GitHub Profile
@drapespy
drapespy / bot_avatar.py
Last active September 18, 2021 07:01
How to change bot avatar from a command in discord.py
@bot.command()
@commands.is_owner()
async def default(ctx):
""" Setting our bot avatar to the default """
# Fetching our file | rb = Read Binary
with open("assets/defaultavatar.png", "rb") as image:
f = image.read() # Reading the image
b = bytearray(f) # Making it a bytes-like object
await self.bot.user.edit(avatar=b) # Editing our bots avatar
await ctx.send('Avatar set to default')