This commit is contained in:
ayntee
2020-11-30 19:32:58 +04:00
2 changed files with 5 additions and 2 deletions
+3 -2
View File
@@ -232,7 +232,7 @@ export function moveMember(
/** Modifies the bot's username or avatar.
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
*/
export function editBotProfile(username?: string, avatarURL?: string) {
export async function editBotProfile(username?: string, avatarURL?: string) {
// Nothing was edited
if (!username && !avatarURL) return;
// Check username requirements if username was provided
@@ -251,11 +251,12 @@ export function editBotProfile(username?: string, avatarURL?: string) {
}
}
const avatar = avatarURL ? await urlToBase64(avatarURL) : undefined;
RequestManager.patch(
endpoints.USER_BOT,
{
username: username?.trim(),
avatar: avatarURL ? urlToBase64(avatarURL) : undefined,
avatar,
},
);
}