nexushub-commands 2.2.1 → 2.2.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.
@@ -13,7 +13,7 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
13
13
  return false;
14
14
  if (!((_a = context.state.mammoth) === null || _a === void 0 ? void 0 : _a.mirror))
15
15
  return true;
16
- const [, , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text) || [];
16
+ const [, , , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text) || [];
17
17
  if (((_b = context.state.mirror) === null || _b === void 0 ? void 0 : _b.isMain) && refCode && Number((_d = (_c = context.user.userDB) === null || _c === void 0 ? void 0 : _c.payload) === null || _d === void 0 ? void 0 : _d.refCode) !== Number(refCode))
18
18
  return true;
19
19
  return false;
@@ -23,7 +23,8 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
23
23
  var _a;
24
24
  const config = Client_1.Client.config(context);
25
25
  if (/\/(start|registration) \d+/.test(context.text) || Number(context.text))
26
- context.user.userDB.payload.refCode = Number((_a = /(\/(start|registration) )?(\d+)/.exec(context.text)) === null || _a === void 0 ? void 0 : _a[2]);
26
+ context.user.userDB.payload.refCode = Number((_a = /(\/(start|registration) )?(\d+)/.exec(context.text)) === null || _a === void 0 ? void 0 : _a[3]);
27
+ console.log({ refCode: context.user.userDB.payload.refCode, text: context.text });
27
28
  if (!context.user.userDB.payload.agreement)
28
29
  return context.sendFormatted({
29
30
  body: [
package/load.sh CHANGED
@@ -1,15 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Параметры
4
- REMOTE_USER="root"
5
- REMOTE_IP="109.120.178.210"
6
- REMOTE_PATH="/root/NFTv2/node_modules/nexushub-commands/"
7
- LOCAL_PATH="./"
8
- export SSHPASS="CIwF179lkIG1"
9
-
10
- # 1. Синхронизация через rsync
11
- echo "Синхронизация файлов..."
12
- sshpass -e rsync -avzP --delete -e "ssh -o StrictHostKeyChecking=no" "$LOCAL_PATH/lib/" "$REMOTE_USER@$REMOTE_IP:$REMOTE_PATH/lib/"
13
- sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart nftv2"
14
-
15
- echo "Готово!"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -8,7 +8,7 @@ export class RegistrationCommand extends Command {
8
8
  if (context.state.fromMirror) return false
9
9
  if (!context.state.mammoth?.mirror) return true
10
10
 
11
- const [, , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text!) || []
11
+ const [, , , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text!) || []
12
12
  if (context.state.mirror?.isMain && refCode && Number(context.user.userDB?.payload?.refCode) !== Number(refCode)) return true
13
13
 
14
14
  return false
@@ -17,7 +17,9 @@ export class RegistrationCommand extends Command {
17
17
  public async execute(context: CommandContext) {
18
18
  const config = Client.config(context)
19
19
 
20
- if (/\/(start|registration) \d+/.test(context.text!) || Number(context.text)) context.user.userDB.payload.refCode = Number(/(\/(start|registration) )?(\d+)/.exec(context.text!)?.[2])
20
+ if (/\/(start|registration) \d+/.test(context.text!) || Number(context.text)) context.user.userDB.payload.refCode = Number(/(\/(start|registration) )?(\d+)/.exec(context.text!)?.[3])
21
+ console.log({ refCode: context.user.userDB.payload.refCode, text: context.text })
22
+
21
23
  if (!context.user.userDB.payload.agreement)
22
24
  return context.sendFormatted(
23
25
  {