v25.8.10
This commit is contained in:
+9
-2
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user