nexushub-commands 2.2.0 → 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.
|
@@ -8,12 +8,13 @@ const migrated_1 = require("evogram/lib/migrated");
|
|
|
8
8
|
const Client_1 = require("../../Client");
|
|
9
9
|
let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand extends migrated_1.Command {
|
|
10
10
|
isExecutable(context) {
|
|
11
|
-
var _a;
|
|
11
|
+
var _a, _b, _c, _d;
|
|
12
12
|
if (context.state.fromMirror)
|
|
13
13
|
return false;
|
|
14
14
|
if (!((_a = context.state.mammoth) === null || _a === void 0 ? void 0 : _a.mirror))
|
|
15
15
|
return true;
|
|
16
|
-
|
|
16
|
+
const [, , , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text) || [];
|
|
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))
|
|
17
18
|
return true;
|
|
18
19
|
return false;
|
|
19
20
|
}
|
|
@@ -21,8 +22,9 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
|
|
|
21
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
23
|
var _a;
|
|
23
24
|
const config = Client_1.Client.config(context);
|
|
24
|
-
if (/\/start \d+/.test(context.text) || Number(context.text))
|
|
25
|
-
context.user.userDB.payload.refCode = Number((_a = /(\/start )?(\d+)/.exec(context.text)) === null || _a === void 0 ? void 0 : _a[
|
|
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[3]);
|
|
27
|
+
console.log({ refCode: context.user.userDB.payload.refCode, text: context.text });
|
|
26
28
|
if (!context.user.userDB.payload.agreement)
|
|
27
29
|
return context.sendFormatted({
|
|
28
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
|
@@ -6,9 +6,10 @@ import { Client, DepositConfig } from '../../Client'
|
|
|
6
6
|
export class RegistrationCommand extends Command {
|
|
7
7
|
public isExecutable(context: CommandContext): boolean {
|
|
8
8
|
if (context.state.fromMirror) return false
|
|
9
|
-
|
|
10
9
|
if (!context.state.mammoth?.mirror) return true
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
const [, , , refCode] = /(\/(start|registration)(\s)?(\d+))?/.exec(context.text!) || []
|
|
12
|
+
if (context.state.mirror?.isMain && refCode && Number(context.user.userDB?.payload?.refCode) !== Number(refCode)) return true
|
|
12
13
|
|
|
13
14
|
return false
|
|
14
15
|
}
|
|
@@ -16,7 +17,9 @@ export class RegistrationCommand extends Command {
|
|
|
16
17
|
public async execute(context: CommandContext) {
|
|
17
18
|
const config = Client.config(context)
|
|
18
19
|
|
|
19
|
-
if (/\/start \d+/.test(context.text!) || Number(context.text)) context.user.userDB.payload.refCode = Number(/(\/start )?(\d+)/.exec(context.text!)?.[
|
|
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
|
+
|
|
20
23
|
if (!context.user.userDB.payload.agreement)
|
|
21
24
|
return context.sendFormatted(
|
|
22
25
|
{
|