mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix: resolve urlToBase64() promise
This commit is contained in:
@@ -233,7 +233,7 @@ export function moveMember(
|
|||||||
/** Modifies the bot's username or avatar.
|
/** Modifies the bot's username or avatar.
|
||||||
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
|
* 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
|
// Nothing was edited
|
||||||
if (!username && !avatarURL) return;
|
if (!username && !avatarURL) return;
|
||||||
// Check username requirements if username was provided
|
// Check username requirements if username was provided
|
||||||
@@ -252,11 +252,12 @@ export function editBotProfile(username?: string, avatarURL?: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const avatar = avatarURL ? await urlToBase64(avatarURL) : undefined;
|
||||||
RequestManager.patch(
|
RequestManager.patch(
|
||||||
endpoints.USER_BOT,
|
endpoints.USER_BOT,
|
||||||
{
|
{
|
||||||
username: username?.trim(),
|
username: username?.trim(),
|
||||||
avatar: avatarURL ? urlToBase64(avatarURL) : undefined,
|
avatar,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user