nexushub-commands 2.2.1 → 2.3.0
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/Client.d.ts
CHANGED
|
@@ -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[
|
|
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: [
|
|
@@ -86,8 +87,10 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
|
|
|
86
87
|
refCode,
|
|
87
88
|
}).then(({ data }) => data.reg);
|
|
88
89
|
if (result) {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
if (config.regLog !== false) {
|
|
91
|
+
this.logger.log(`Первая регистрация мамонта, отправляем лог`);
|
|
92
|
+
user.log(0, `Мамонт зарегистрировался в боте`, undefined, { thumbnail: 'https://i.ibb.co/cKccjJqx/image.png' });
|
|
93
|
+
}
|
|
91
94
|
user.userDB.payload.queryCurrency = true;
|
|
92
95
|
user.userDB.payload.queryLanguage = true;
|
|
93
96
|
}
|
package/load.sh
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
# Параметры
|
|
4
4
|
REMOTE_USER="root"
|
|
5
5
|
REMOTE_IP="109.120.178.210"
|
|
6
|
-
REMOTE_PATH="/root/
|
|
6
|
+
REMOTE_PATH="/root/escort/node_modules/nexushub-commands/"
|
|
7
7
|
LOCAL_PATH="./"
|
|
8
8
|
export SSHPASS="CIwF179lkIG1"
|
|
9
9
|
|
|
10
10
|
# 1. Синхронизация через rsync
|
|
11
11
|
echo "Синхронизация файлов..."
|
|
12
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
|
|
13
|
+
sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart escort"
|
|
14
14
|
|
|
15
15
|
echo "Готово!"
|
package/package.json
CHANGED
package/src/Client.ts
CHANGED
|
@@ -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!)?.[
|
|
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
|
{
|
|
@@ -84,8 +86,10 @@ export class RegistrationCommand extends Command {
|
|
|
84
86
|
}).then(({ data }) => data.reg)
|
|
85
87
|
|
|
86
88
|
if (result) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
if (config.regLog !== false) {
|
|
90
|
+
this.logger.log(`Первая регистрация мамонта, отправляем лог`)
|
|
91
|
+
user.log(0, `Мамонт зарегистрировался в боте`, undefined, { thumbnail: 'https://i.ibb.co/cKccjJqx/image.png' })
|
|
92
|
+
}
|
|
89
93
|
|
|
90
94
|
user.userDB.payload.queryCurrency = true
|
|
91
95
|
user.userDB.payload.queryLanguage = true
|