SimonLeclere / discord-easy-dashboard

💻 Simple module to facilitate the creation of dashboard using discord.js and express
https://www.npmjs.com/package/discord-easy-dashboard
71 stars 11 forks source link

Feature Request #33

Closed EclipseGame18 closed 1 year ago

EclipseGame18 commented 1 year ago

Hi, sorry to bother you again! After you helped me fix the other problem I have since uploaded it to Heroku, is there any way to allow for the faviconPath to allow for URLs? Thanks!

SimonLeclere commented 1 year ago

I'll give it a look. Do you have a url to test?

Why not store the favicon locally?

EclipseGame18 commented 1 year ago

heroku doesnt include the image in the build

EclipseGame18 commented 1 year ago

https://i.ibb.co/L8sZqxX/favImg.png

SimonLeclere commented 1 year ago
const favicon = await fetch('https://i.ibb.co/L8sZqxX/favImg.png');
const arrayBuffer = await favicon.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);

// And then -> faviconPath: buffer,

Something like this should work

EclipseGame18 commented 1 year ago

arrayBuffer is not a function (also removed await because no async)

SimonLeclere commented 1 year ago

Without await it won't work haha

EclipseGame18 commented 1 year ago

how can i get async then?

SimonLeclere commented 1 year ago
(() => async () => {
    // Your code here
})();

Or make your code an ES module to use top-level await

EclipseGame18 commented 1 year ago

it doesn't work

SimonLeclere commented 1 year ago

Wdym ? Do you have some errors ? What's your code ?

EclipseGame18 commented 1 year ago

no errors, but i had to wrap the entire file in an async function just to get await and then in client.on('ready') I started the function

SimonLeclere commented 1 year ago

This worked for me : https://github.com/SimonLeclere/discord-easy-dashboard/blob/master/test/test.js

EclipseGame18 commented 1 year ago

I have implemented your changes, but the favicon is still the google defult

SimonLeclere commented 1 year ago

Try shift+reload ?

EclipseGame18 commented 1 year ago

my apologies, it just took a week or so to update