I'm trying to build a graphic interface for a discord bot I wrote using discordjs. However, I encountered a problem with sending image.
This is the part of my code responsible for sending a message to a user :
utilsateur.createDM().then(channeltemp => {
let attachment = new Discord.MessageAttachment('./image.png');
channelDM = channeltemp;
channelDM.send("message", attachment);
});
The image "image.png" is located in the same folder as the script. I've been running my script on nodejs without any problem, however when I tried to run the script via the html page of my electron app, I'm getting this error :
Uncaught (in promise) TypeError [REQ_RESOURCE_TYPE]: The resource must be a string, Buffer or a valid file stream.
I think it has nothing to do with pathing because I tried changing my path (absolute, relative, ...) without any success and moreover, I'm able to access some data in an excel in my electron app.
Does anyone have a clue about how to solve my problem ?
I'm sorry if I made some mistakes about technical terms (I'm a beginner) or even grammatical mistakes as English isn't my native language.
Appreciate your help ! :)