mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-27 22:34:11 +00:00
Fix base64 avatar stuff for webhooks
This commit is contained in:
@@ -205,7 +205,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
|
||||
}
|
||||
if (opts.avatar_url) {
|
||||
const avatarData = await fetch(opts.avatar_url);
|
||||
const base64 = await avatarData.text().then((x) => btoa(x));
|
||||
const base64 = await avatarData.arrayBuffer().then((x) => Buffer.from(x).toString("base64"));
|
||||
|
||||
const dataUri = "data:" + avatarData.headers.get("content-type") + ";base64," + base64;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user