Last active
October 11, 2023 13:54
-
-
Save MrLotU/b11d868243062ba9210f4994c1158d43 to your computer and use it in GitHub Desktop.
Changes the profile picture of a discord bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
############################################################################################################################# | |
# USAGE: # | |
# 0. Make sure you have python 3.5 + installed and have discord.py installed (pip3 install discord) # | |
# 1. Download the python file # | |
# 2. Change the token variable to hold your bots token and the pfp variable to hold the path to your desired pfp # | |
# 3. Run your file using `python3 path/to/file.py # | |
# 3. That's it, you can keep the file or delete it again! # | |
############################################################################################################################# | |
client = discord.Client() | |
token = 'TOKEN HERE' | |
pfp_path = "path/to/file.png" | |
fp = open(pfp_path, 'rb') | |
pfp = fp.read() | |
@client.event | |
async def on_ready(): | |
await client.edit_profile(password=None, avatar=pfp) | |
client.run(token) |
Thanks
thanks
thanks
Hi,
Where i can find bot token, i used Rythm bot for music.
Can i still change its avatar
This only works for bots you own yourself. Not public bots.
After using the code more than once, it just says that im 'changing avatar too fast' in an error message.
True. It seems that after you change it once through code it just acts as if you changed it a billion times.
If you're getting an intents error, change line 12 to:
client = discord.Client(intents=discord.Intents.default())
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For newer versions of the API, line 22 needs to be changed to:
(I also removed password=None, since it works without it)