This commit is contained in:
2025-08-27 01:21:23 +09:00
parent b9a4fe8763
commit 81e9bea8ab
18 changed files with 368 additions and 63 deletions
+9 -2
View File
@@ -1,6 +1,7 @@
import { createCanvas, loadImage, registerFont } from "canvas";
import sharp from "sharp";
import { MiQOptions } from "./miq";
import { readFileSync } from "fs";
// フォント読み込み
registerFont("miq/fonts/MPLUS.ttf", {
@@ -77,10 +78,16 @@ async function iconReplace(
) {
let result = "";
const buffer = await(await fetch(iconURL, {
const bufferReq = await fetch(iconURL, {
method: "GET",
cache: "no-store",
})).arrayBuffer();
});
if (bufferReq.status < 200 || bufferReq.status > 299) {
return readFileSync("miq/PersonIcon.txt", "utf-8");
}
const buffer = await bufferReq.arrayBuffer();
if (color) {
const img = await sharp(Buffer.from(buffer))