-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
colorama | ||
requests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import requests | ||
import base64 | ||
from colorama import Fore, Style, Back | ||
|
||
print(Fore.LIGHTGREEN_EX + """ _______ ______ ________ __ | ||
/ \ / \ / | / | | ||
$$$$$$$ |/$$$$$$ |______ $$$$$$$$/______ ______ $$ | | ||
$$ |__$$ |$$ |_ $$// \ $$ | / \ / \ $$ | | ||
$$ $$/ $$ | /$$$$$$ | $$ |/$$$$$$ |/$$$$$$ |$$ | | ||
$$$$$$$/ $$$$/ $$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | | ||
$$ | $$ | $$ |__$$ | $$ |$$ \__$$ |$$ \__$$ |$$ | | ||
$$ | $$ | $$ $$/ $$ |$$ $$/ $$ $$/ $$ | | ||
$$/ $$/ $$$$$$$/ $$/ $$$$$$/ $$$$$$/ $$/ | ||
$$ | | ||
$$ | | ||
$$/ """, Style.RESET_ALL) | ||
|
||
|
||
token = input("Bot Token: ") | ||
path_pfp = input("New animated avatar Path: ") | ||
|
||
def update_avatar(): | ||
try: | ||
with open(path_pfp, 'rb') as file: | ||
new_avatar = file.read() | ||
|
||
headers = { | ||
'Authorization': f'Bot {token}', | ||
'Content-Type': 'application/json' | ||
} | ||
|
||
avatar_base64 = base64.b64encode(new_avatar).decode('utf-8') | ||
body = { | ||
'avatar': f'data:image/gif;base64,{avatar_base64}' | ||
} | ||
|
||
response = requests.patch('https://discord.com/api/v9/users/@me', headers=headers, json=body) | ||
|
||
if response.ok: | ||
print(Fore.GREEN, "[+]", Fore.LIGHTGREEN_EX + 'Avatar updated successfully!', Style.RESET_ALL) | ||
print(Fore.GREEN, "[!!!]", Fore.LIGHTGREEN_EX + 'don\'t forget to leave a star! (https://github.com/Sitois/Pfp-Tool)', Style.RESET_ALL) | ||
else: | ||
print(Fore.RED, "[!]", Fore.LIGHTRED_EX, 'Failed to update avatar:', response.status_code) | ||
print('Response body:', response.text, Style.RESET_ALL) | ||
except Exception as e: | ||
print(Fore.RED, "[!]", Fore.LIGHTRED_EX, 'Error while updating avatar:', e, Style.RESET_ALL) | ||
|
||
update_avatar() |