koishi-plugin-starfx-bot 0.13.5 → 0.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -2
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/index.js
CHANGED
|
@@ -141,6 +141,7 @@ async function getImageSrc(session, param, option) {
|
|
|
141
141
|
if (quoteElementArray?.length) {
|
|
142
142
|
for (const element of quoteElementArray) {
|
|
143
143
|
if (img && element?.type === "img") {
|
|
144
|
+
return element?.attrs?.src;
|
|
144
145
|
} else if (at && element?.type === "at" && element?.attrs?.id && element.attrs.id !== session.selfId) {
|
|
145
146
|
return `https://q1.qlogo.cn/g?b=qq&nk=${element?.attrs?.id}&s=640`;
|
|
146
147
|
}
|
|
@@ -540,12 +541,12 @@ function apply(ctx, cfg) {
|
|
|
540
541
|
ctx.command("bdbd [param]").option("starNum", "-n <starNum: number>").option("color", "-c <color: string>").option("train", "-t <train: string>").option("band", "-b <band: string>").action(async ({ session, options }, param) => {
|
|
541
542
|
if (detectControl(controlJson, session.guildId, "bdbd")) {
|
|
542
543
|
const p = session.send("图片处理中请稍等...");
|
|
543
|
-
console.log(param
|
|
544
|
+
console.log(param?.slice(0, 1e3));
|
|
544
545
|
const drawConfig = await handleBanGDreamConfig(options);
|
|
545
546
|
const imgSrc = await getImageSrc(session, param);
|
|
546
547
|
if (!imgSrc?.length) return "输入无效";
|
|
547
548
|
const imageBase64 = await drawBanGDream(imgSrc, drawConfig);
|
|
548
|
-
if (!imageBase64?.length) return "
|
|
549
|
+
if (!imageBase64?.length) return "输入无效...";
|
|
549
550
|
await p;
|
|
550
551
|
await session.send(import_koishi2.h.image(imageBase64));
|
|
551
552
|
}
|
package/package.json
CHANGED