Markoudstaal / node-red-contrib-discord-advanced

Recieve, send, edit and delete Discord messages in node-red.
MIT License
46 stars 16 forks source link

Reset image cache #49

Closed TristanMW closed 1 year ago

TristanMW commented 1 year ago

Good Morning

I am trying to post multiple QR codes as single embedded messages within discords "image cached" period. meaning even though the QR code has changed, discord still grabs the previous QR code that was generated. Anyone have an idea how I can reset this before it sends via MessageManager?

javis86 commented 1 year ago

Could you post an example of the input data for you case?

TristanMW commented 1 year ago

image What I do is ping my devices then if its online manipulate the data to create a QR code and add it to the embedded message.

Even though I am deleting the data out of the local directory and creating a new qrcode.png file, discord continues to grab the cached original image, as seen below.

image

I did some research and found that the only way around would be to make the qrcode generate with a unique name every time by adding a timestamp or even a random number to it. Such as qrcode1.png , qrcode2.png This works but brings up the issue to storage. Images are small but ideally I wouldn't like to keep an eye out on storage usage if you know what I mean.

I will close this ticket as technically its fixed but if anyone has anything to add please do.

javis86 commented 1 year ago

you could make a flow that deletes files older than x minutes/hour or period of time.