koishi-plugin-starfx-bot 0.18.0 → 0.18.1
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 +7 -2
- package/package.json +1 -1
- package/readme.md +1 -0
package/lib/index.js
CHANGED
|
@@ -308,8 +308,9 @@ async function getImageFromUrl(ctx, url) {
|
|
|
308
308
|
}
|
|
309
309
|
__name(getImageFromUrl, "getImageFromUrl");
|
|
310
310
|
async function atNotSayReply(cfg, session, elements) {
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
const trimElements = elements.filter((e) => !(e.type === "text" && /^\s*$/.test(e.attrs.content)));
|
|
312
|
+
if ((cfg.atNotSay || cfg.atNotSayOther) && trimElements.length === 1 && trimElements[0].type === "at") {
|
|
313
|
+
const isAtSelf = trimElements[0].attrs.id === session.selfId;
|
|
313
314
|
if (isAtSelf && cfg.atNotSay && import_koishi.Random.bool(cfg.atNotSayProperty)) {
|
|
314
315
|
await session.send(session.text("middleware.messages.atNotReply"));
|
|
315
316
|
} else if (!isAtSelf && cfg.atNotSayOther && import_koishi.Random.bool(cfg.atNotSayOtherProperty)) {
|
|
@@ -937,6 +938,10 @@ function apply(ctx, cfg) {
|
|
|
937
938
|
});
|
|
938
939
|
if (process.env.NODE_ENV === "development") {
|
|
939
940
|
ctx.command("test").action(async ({ session }) => {
|
|
941
|
+
await session.send(" d d ");
|
|
942
|
+
});
|
|
943
|
+
ctx.middleware(async (session, next) => {
|
|
944
|
+
return next();
|
|
940
945
|
});
|
|
941
946
|
}
|
|
942
947
|
function initAssets() {
|
package/package.json
CHANGED
package/readme.md
CHANGED