-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
bugSomething isn't workingSomething isn't workingneeds investigateNeeds to be investigated to find the root causeNeeds to be investigated to find the root cause
Description
What version of Bun is running?
1.1.0+5903a6141
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
import { SlashCommandBuilder } from "@discordjs/builders";
import { Client, CommandInteraction } from "discord.js";
import { Canvas, loadImage, loadFont } from "canvas-constructor/skia";
import { EconomyModel } from "../models/economy";
loadFont("PoppinsBold", "./fonts/Poppins-SemiBold.otf");
loadFont("Poppins", "./fonts/Poppins-Regular.otf");
loadFont("PoppinsMedium", "./fonts/Poppins-Medium.otf");
import {formatNumber} from "../utils/mathUtils";
export default {
data: new SlashCommandBuilder()
.setName("bakiye")
.setDescription("Cüzdanını incele, bakiyeni gör."),
run: async (client: Client, interaction: CommandInteraction) => {
let economyData = await EconomyModel.findOne({ id: interaction.user.id });
//@ts-ignore
const numberWithCommas = formatNumber(economyData.cash);
const nick = interaction.user.username;
const canvas = new Canvas(343, 180);
const kiremit = await loadImage(`./src/img/bakiye.png`);
canvas.printImage(kiremit, 0, 0);
canvas.setColor("#2AD100");
canvas.setTextAlign("center")
canvas.setTextFont("14px Poppins");
canvas.printText(`▲ +$5534 (%32)`, 171, 147);
canvas.setColor("#D9D9D9");
canvas.setTextFont("39px PoppinsBold");
canvas.printText(`$ ${numberWithCommas}`, 171, 91);
const attachment = canvas.toBuffer("png");
await interaction.reply({
content: `> **Bakiye • [ ${nick} ] • <:wallet1:1224509010284118046>**`,
files: [attachment],
});
},
};
or anything that uses skia-canvas for mine thats the thing
What is the expected behavior?
load command and send a image rendered with skia-canvas to channel but bot ignores command since skia-canvas throws an error
What do you see instead?
Additional information
No response
zfedoran, dienstbereit, radarsu and TomasHubelbauer
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds investigateNeeds to be investigated to find the root causeNeeds to be investigated to find the root cause