kibubek
kibubek
DIAdiscord.js - Imagine an app
Created by kibubek on 9/16/2023 in #djs-questions
Security actions implemented, yet?
Thanks, hope it'll be implemented soon!
5 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
Thank you for providing solutions, i'll close this post since it's fixed
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
Nope, permissions were fine, it saved/deleted images as expected. File existed, and existed in time for it to get processed
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
Also it's fixed, if anyone stumbles upon a similiar issue, good luck, it's hell. In summary the issue was caused either by something weird, or these issues: - fs acts different on linux than windows - It didnt process the image correctly in the stream (Happens even now, but I made a reprocessing function as a workaround) I ended up compressing the images to 70% quality (Which I should've done at the start lol) It works okayish now, which is acceptable for me
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
I need to work with those images in outside of this scope. It's also an archiver and we've ran into issues where discord cdn deletes files after a while, when the original message is deleted -> hence defeating the purpose of archiving
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
async function saveImage(message) {

const attachment = message.attachments.first();

if (attachment) {
try {
const response = await axios.get(attachment.url, { responseType: 'arraybuffer' });
const buffer = Buffer.from(response.data, 'binary');
const base64 = buffer.toString('base64');


Image.create({
userId: message.author.id,
messageTimestamp: message.createdTimestamp.toString().slice(0, -3),
messageUrl: message.url,
messageId: message.id,
//image: `data:${attachment.contentType};base64,${base64}`
image: base64
});
} catch (error) {
console.error('Error saving image to database:', error);
}
}
}
async function saveImage(message) {

const attachment = message.attachments.first();

if (attachment) {
try {
const response = await axios.get(attachment.url, { responseType: 'arraybuffer' });
const buffer = Buffer.from(response.data, 'binary');
const base64 = buffer.toString('base64');


Image.create({
userId: message.author.id,
messageTimestamp: message.createdTimestamp.toString().slice(0, -3),
messageUrl: message.url,
messageId: message.id,
//image: `data:${attachment.contentType};base64,${base64}`
image: base64
});
} catch (error) {
console.error('Error saving image to database:', error);
}
}
}
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 4/11/2023 in #djs-questions
Resending image in embed doesn't work on production, but works on dev
10 replies
DIAdiscord.js - Imagine an app
Created by kibubek on 2/12/2023 in #djs-questions
Automatically revive archived threads
Yes, you're right, thank you! Closing post
3 replies