Fixed stuff
This commit is contained in:
@@ -8,7 +8,14 @@ RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN apt-get update && apt-get install -y fontconfig
|
||||
#Installing fonts
|
||||
|
||||
RUN apt-get update || true
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
gnupg \
|
||||
ca-certificates \
|
||||
fontconfig || true
|
||||
|
||||
RUN mkdir -p /usr/local/share/fonts/truetype/fredoka
|
||||
COPY ./wwwroot/assets/fonts/Fredoka/fredoka.ttf /usr/local/share/fonts/truetype/fredoka/fredoka.ttf
|
||||
RUN fc-cache -fv
|
||||
|
||||
2
bot.js
2
bot.js
@@ -42,7 +42,7 @@ const launch = async () => {
|
||||
username: username,
|
||||
});
|
||||
|
||||
const attachment = new AttachmentBuilder(result, { name: 'namecard.png' });
|
||||
const attachment = new AttachmentBuilder(Buffer.from(result.result), { name: 'namecard.png' });
|
||||
|
||||
const channel = await member.guild.channels.fetch(data.welcomeChannelID);
|
||||
await channel.send({ files: [attachment] });
|
||||
|
||||
@@ -8,9 +8,15 @@ const name = "Aude Vaiselle";
|
||||
|
||||
|
||||
try{
|
||||
const creator = new NameCardCreator(templatePath);
|
||||
const result = await launchWorker({
|
||||
templatePath: data.nameCardTemplate,
|
||||
avatarURL: avatarPath,
|
||||
username: name,
|
||||
});
|
||||
|
||||
const buffer = Buffer.from(result.result);
|
||||
console.log(buffer);
|
||||
|
||||
await creator.getWelcomeCard(avatarPath, name);
|
||||
console.log("Generation successful ✅")
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -8,7 +8,9 @@ parentPort.on("message", async (data) => {
|
||||
const creator = new NameCardCreator(templatePath);
|
||||
const buffer = await creator.getWelcomeCard(avatarURL, username);
|
||||
|
||||
parentPort.postMessage({ result: buffer }, [buffer.buffer]);
|
||||
console.log(buffer);
|
||||
|
||||
parentPort.postMessage({ result: buffer });
|
||||
|
||||
} catch (err) {
|
||||
parentPort.postMessage({ error: err.message });
|
||||
|
||||
Reference in New Issue
Block a user