nodestatus-server 1.2.5-beta.1 → 1.2.5-beta.2

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/build/app.js CHANGED
@@ -149761,13 +149761,14 @@ function createPush(options) {
149761
149761
  };
149762
149762
  const getBotStatus = (targets) => {
149763
149763
  let str = "";
149764
- let online = 0;
149764
+ let total = 0, online = 0;
149765
149765
  this.serversPub.forEach((obj) => {
149766
149766
  if (targets.length) {
149767
149767
  if (!targets.some((target) => obj.name.toLocaleLowerCase().includes(target))) {
149768
149768
  return;
149769
149769
  }
149770
149770
  }
149771
+ total++;
149771
149772
  const item = new Proxy(obj, {
149772
149773
  get(target, key) {
149773
149774
  const value = Reflect.get(target, key);
@@ -149795,7 +149796,7 @@ function createPush(options) {
149795
149796
  str += "\n";
149796
149797
  });
149797
149798
  return `\u{1F34A}*NodeStatus*
149798
- \u{1F916} \u5F53\u524D\u6709 ${this.serversPub.length} \u53F0\u670D\u52A1\u5668, \u5176\u4E2D\u5728\u7EBF ${online} \u53F0
149799
+ \u{1F916} \u5F53\u524D\u6709 ${total} \u53F0\u670D\u52A1\u5668, \u5176\u4E2D\u5728\u7EBF ${online} \u53F0
149799
149800
 
149800
149801
  ${str}`;
149801
149802
  };
@@ -149824,7 +149825,16 @@ Please check your settings\\.`, { parse_mode: "MarkdownV2" });
149824
149825
  }
149825
149826
  });
149826
149827
  bot.command("status", (ctx) => {
149827
- const targets = ctx.message.text.slice(7).trim().toLocaleLowerCase().split(" ").map((item) => item.trim());
149828
+ const { entities: entities2 } = ctx.message;
149829
+ const msg = ctx.message.text.toLocaleLowerCase().split("");
149830
+ if (entities2) {
149831
+ let len = 0;
149832
+ entities2.forEach((entity) => {
149833
+ msg.splice(entity.offset - len, entity.length);
149834
+ len += entity.length;
149835
+ });
149836
+ }
149837
+ const targets = msg.join("").split(" ").map((item) => item.trim()).filter((item) => item);
149828
149838
  if (chatId.has(ctx.message.chat.id.toString())) {
149829
149839
  ctx.reply(getBotStatus(targets), { parse_mode: "MarkdownV2" });
149830
149840
  } else {