nexushub-commands 2.5.1 → 2.5.3
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.
|
@@ -20,18 +20,17 @@ let RegistrationCommand = RegistrationCommand_1 = class RegistrationCommand exte
|
|
|
20
20
|
}
|
|
21
21
|
execute(context) {
|
|
22
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
var _a, _b, _c;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f;
|
|
24
24
|
const config = Client_1.Client.config(context);
|
|
25
25
|
if (/\/(start|registration) \d+/.test(context.text) || Number(context.text))
|
|
26
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 });
|
|
28
27
|
if (!context.user.userDB.payload.agreement)
|
|
29
28
|
return context.sendFormatted({
|
|
30
29
|
designImages: ['registration', 'banner'],
|
|
31
30
|
body: [
|
|
32
31
|
{
|
|
33
32
|
title: `🎉 Привет, {{ ${context.user.fullname} }}!`,
|
|
34
|
-
data: [[`<a href="${((_b = context.state.mirror) === null || _b === void 0 ? void 0 : _b.projectMirror.userAgreement) || ((
|
|
33
|
+
data: [[`<a href="${((_c = (_b = context.state.mirror) === null || _b === void 0 ? void 0 : _b.projectMirror) === null || _c === void 0 ? void 0 : _c.userAgreement) || ((_f = (_e = (_d = context === null || context === void 0 ? void 0 : context.state) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.find((x) => x.name === 'userAgreement')) === null || _f === void 0 ? void 0 : _f.value) || config.agreement}">Политика и условия пользования</a>`]],
|
|
35
34
|
},
|
|
36
35
|
],
|
|
37
36
|
}, {
|
package/package.json
CHANGED
|
@@ -18,7 +18,6 @@ export class RegistrationCommand extends Command {
|
|
|
18
18
|
const config = Client.config(context)
|
|
19
19
|
|
|
20
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
22
|
if (!context.user.userDB.payload.agreement)
|
|
24
23
|
return context.sendFormatted(
|
|
@@ -27,7 +26,7 @@ export class RegistrationCommand extends Command {
|
|
|
27
26
|
body: [
|
|
28
27
|
{
|
|
29
28
|
title: `🎉 Привет, {{ ${context.user.fullname} }}!`,
|
|
30
|
-
data: [[`<a href="${context.state.mirror?.projectMirror
|
|
29
|
+
data: [[`<a href="${context.state.mirror?.projectMirror?.userAgreement || context?.state?.settings?.find((x: any) => x.name === 'userAgreement')?.value || config.agreement}">Политика и условия пользования</a>`]],
|
|
31
30
|
},
|
|
32
31
|
],
|
|
33
32
|
},
|