nexushub-commands 2.0.2 → 2.0.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.
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EscortCreateModelCommand = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const evogram_1 = require("evogram");
7
+ const migrated_1 = require("evogram/lib/migrated");
8
+ let EscortCreateModelCommand = class EscortCreateModelCommand extends SharedCommand {
9
+ execute(context, name, age, about, services, rating, specifications, _) {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ const model = yield this.API.post(`/commands/${this.constructor.name}/createModel`, { name, age, about, services, rating, specifications, workerId: context.user.id }).then((res) => res.data);
12
+ return context.redirect(migrated_1.CommandManager.getCommandByName('EscortModelsCommand'), { model: model.id });
13
+ });
14
+ }
15
+ };
16
+ exports.EscortCreateModelCommand = EscortCreateModelCommand;
17
+ tslib_1.__decorate([
18
+ tslib_1.__param(1, (0, evogram_1.CommandArgument)({
19
+ name: 'name',
20
+ question: ({ context }) => context
21
+ .sendFormattedQuestion({
22
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
23
+ footer: '<i>Отправьте имя модели в следующем сообщении</i>',
24
+ })
25
+ .then((message) => message.text),
26
+ }
27
+ // stringValidator({ max: 20 })
28
+ )),
29
+ tslib_1.__param(2, (0, evogram_1.CommandArgument)({
30
+ name: 'age',
31
+ question: ({ context }) => context
32
+ .sendFormattedQuestion({
33
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
34
+ footer: '<i>Отправьте возраст модели в следующем сообщении (от 18 до 99 лет)</i>',
35
+ })
36
+ .then((message) => message.text),
37
+ }
38
+ // numberValidator({ min: 18, max: 99 })
39
+ )),
40
+ tslib_1.__param(3, (0, evogram_1.CommandArgument)({
41
+ name: 'about',
42
+ question: ({ context }) => context
43
+ .sendFormattedQuestion({
44
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
45
+ footer: '<i>Отправьте описание модели в следующем сообщении (не более 1000 символов)</i>',
46
+ })
47
+ .then((message) => message.text),
48
+ }
49
+ // stringValidator({ max: 1000 })
50
+ )),
51
+ tslib_1.__param(4, (0, evogram_1.CommandArgument)({
52
+ name: 'services',
53
+ question: ({ context }) => context
54
+ .sendFormattedQuestion({
55
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
56
+ footer: '<i>Отправьте услуги модели в следующем сообщении (через запятую)</i>',
57
+ })
58
+ .then((message) => message.text),
59
+ },
60
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
61
+ ({ value }) => value.split(',').map((x) => x.trim()))),
62
+ tslib_1.__param(5, (0, evogram_1.CommandArgument)({
63
+ name: 'rating',
64
+ question: ({ context }) => context
65
+ .sendFormattedQuestion({
66
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
67
+ footer: '<i>Отправьте рейтинг модели в следующем сообщении (от 0.00 до 5.00)</i>',
68
+ })
69
+ .then((message) => message.text),
70
+ }
71
+ // numberValidator({ min: 0, max: 5, allowFloat: true })
72
+ )),
73
+ tslib_1.__param(6, (0, evogram_1.CommandArgument)({
74
+ name: 'specifications',
75
+ question: ({ context, error }) => context
76
+ .sendFormattedQuestion({
77
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
78
+ footer: `<i>Отправьте спецификации модели в следующем сообщении через запятую (${Object.values({
79
+ ethnicity: 'Этническая группа',
80
+ physique: 'Телосложение',
81
+ hair_color: 'Цвет волос',
82
+ height: 'Рост',
83
+ weight: 'Вес',
84
+ breasts: 'Грудь',
85
+ }).join(', ')})</i>`,
86
+ error: error === null || error === void 0 ? void 0 : error.message,
87
+ })
88
+ .then((message) => message.text),
89
+ },
90
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
91
+ ({ value }) => value
92
+ .split(',')
93
+ .map((x) => x.trim())
94
+ .slice(0, 6), ({ value }) => {
95
+ if (value.length < 6)
96
+ throw new Error('Вы указали не все спецификации');
97
+ else
98
+ return value;
99
+ })),
100
+ tslib_1.__param(7, (0, evogram_1.CommandArgument)('confirm', ({ context, value, validateArgs, args }) => {
101
+ if (value)
102
+ return value;
103
+ console.log({ validateArgs, args });
104
+ context.sendFormatted({
105
+ header: `<blockquote><b>👱‍♀️ Регистрация новой модели ${validateArgs.name} [${validateArgs.age} лет]</b></blockquote>\n\n` + `<i>${validateArgs.about}</i>`,
106
+ body: [
107
+ {
108
+ title: 'ℹ️ Информация о моделе',
109
+ data: Array.from({ length: validateArgs.specifications.length }, (_, i) => [
110
+ Object.values({
111
+ ethnicity: 'Этническая группа',
112
+ physique: 'Телосложение',
113
+ hair_color: 'Цвет волос',
114
+ height: 'Рост',
115
+ weight: 'Вес',
116
+ breasts: 'Грудь',
117
+ })[i],
118
+ validateArgs.specifications[i],
119
+ ]),
120
+ },
121
+ ],
122
+ footer: `<b>💄 Услуги, входящие в стоимость тарифа:</b> <i>${validateArgs.services.length ? validateArgs.services.join(', ') : '-'}</i>`,
123
+ }, {
124
+ reply_markup: {
125
+ inline_keyboard: [[{ text: '✅ Подтвердить', command: EscortCreateModelCommand, payload: Object.assign(Object.assign({}, args), { confirm: true }) }]],
126
+ },
127
+ });
128
+ })),
129
+ tslib_1.__metadata("design:type", Function),
130
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof CommandContext !== "undefined" && CommandContext) === "function" ? _a : Object, String, Number, String, Array, Number, Array, Boolean]),
131
+ tslib_1.__metadata("design:returntype", Promise)
132
+ ], EscortCreateModelCommand.prototype, "execute", null);
133
+ exports.EscortCreateModelCommand = EscortCreateModelCommand = tslib_1.__decorate([
134
+ (0, migrated_1.CommandD)({ name: 'escortcreatemodel', backButton: 'К созданию модели' })
135
+ ], EscortCreateModelCommand);
136
+ async;
137
+ inlineExecute(context, migrated_1.InlineQueryContext, ...args, any);
138
+ { }
@@ -0,0 +1,151 @@
1
+ import { CommandArgument } from 'evogram'
2
+ import { CommandD, CommandManager, InlineQueryContext } from 'evogram/lib/migrated'
3
+
4
+ @CommandD({ name: 'escortcreatemodel', backButton: 'К созданию модели' })
5
+ export class EscortCreateModelCommand extends SharedCommand {
6
+ async execute(
7
+ context: CommandContext,
8
+ @CommandArgument(
9
+ {
10
+ name: 'name',
11
+ question: ({ context }) =>
12
+ context
13
+ .sendFormattedQuestion({
14
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
15
+ footer: '<i>Отправьте имя модели в следующем сообщении</i>',
16
+ })
17
+ .then((message) => message.text),
18
+ }
19
+ // stringValidator({ max: 20 })
20
+ )
21
+ name: string,
22
+ @CommandArgument(
23
+ {
24
+ name: 'age',
25
+ question: ({ context }) =>
26
+ context
27
+ .sendFormattedQuestion({
28
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
29
+ footer: '<i>Отправьте возраст модели в следующем сообщении (от 18 до 99 лет)</i>',
30
+ })
31
+ .then((message) => message.text),
32
+ }
33
+ // numberValidator({ min: 18, max: 99 })
34
+ )
35
+ age: number,
36
+ @CommandArgument(
37
+ {
38
+ name: 'about',
39
+ question: ({ context }) =>
40
+ context
41
+ .sendFormattedQuestion({
42
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
43
+ footer: '<i>Отправьте описание модели в следующем сообщении (не более 1000 символов)</i>',
44
+ })
45
+ .then((message) => message.text),
46
+ }
47
+ // stringValidator({ max: 1000 })
48
+ )
49
+ about: string,
50
+ @CommandArgument(
51
+ {
52
+ name: 'services',
53
+ question: ({ context }) =>
54
+ context
55
+ .sendFormattedQuestion({
56
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
57
+ footer: '<i>Отправьте услуги модели в следующем сообщении (через запятую)</i>',
58
+ })
59
+ .then((message) => message.text),
60
+ },
61
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
62
+ ({ value }) => value.split(',').map((x) => x.trim())
63
+ )
64
+ services: string[],
65
+ @CommandArgument(
66
+ {
67
+ name: 'rating',
68
+ question: ({ context }) =>
69
+ context
70
+ .sendFormattedQuestion({
71
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
72
+ footer: '<i>Отправьте рейтинг модели в следующем сообщении (от 0.00 до 5.00)</i>',
73
+ })
74
+ .then((message) => message.text),
75
+ }
76
+ // numberValidator({ min: 0, max: 5, allowFloat: true })
77
+ )
78
+ rating: number,
79
+ @CommandArgument(
80
+ {
81
+ name: 'specifications',
82
+ question: ({ context, error }) =>
83
+ context
84
+ .sendFormattedQuestion({
85
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
86
+ footer: `<i>Отправьте спецификации модели в следующем сообщении через запятую (${Object.values({
87
+ ethnicity: 'Этническая группа',
88
+ physique: 'Телосложение',
89
+ hair_color: 'Цвет волос',
90
+ height: 'Рост',
91
+ weight: 'Вес',
92
+ breasts: 'Грудь',
93
+ }).join(', ')})</i>`,
94
+ error: error?.message,
95
+ })
96
+ .then((message) => message.text),
97
+ },
98
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
99
+ ({ value }) =>
100
+ value
101
+ .split(',')
102
+ .map((x) => x.trim())
103
+ .slice(0, 6),
104
+ ({ value }) => {
105
+ if (value.length < 6) throw new Error('Вы указали не все спецификации')
106
+ else return value
107
+ }
108
+ )
109
+ specifications: string[],
110
+ @CommandArgument('confirm', ({ context, value, validateArgs, args }) => {
111
+ if (value) return value
112
+ console.log({ validateArgs, args })
113
+
114
+ context.sendFormatted(
115
+ {
116
+ header: `<blockquote><b>👱‍♀️ Регистрация новой модели ${validateArgs.name} [${validateArgs.age} лет]</b></blockquote>\n\n` + `<i>${validateArgs.about}</i>`,
117
+ body: [
118
+ {
119
+ title: 'ℹ️ Информация о моделе',
120
+ data: Array.from({ length: validateArgs.specifications.length }, (_, i) => [
121
+ Object.values({
122
+ ethnicity: 'Этническая группа',
123
+ physique: 'Телосложение',
124
+ hair_color: 'Цвет волос',
125
+ height: 'Рост',
126
+ weight: 'Вес',
127
+ breasts: 'Грудь',
128
+ })[i],
129
+ validateArgs.specifications[i],
130
+ ]),
131
+ },
132
+ ],
133
+ footer: `<b>💄 Услуги, входящие в стоимость тарифа:</b> <i>${validateArgs.services.length ? validateArgs.services.join(', ') : '-'}</i>`,
134
+ },
135
+ {
136
+ reply_markup: {
137
+ inline_keyboard: [[{ text: '✅ Подтвердить', command: EscortCreateModelCommand, payload: { ...args, confirm: true } }]],
138
+ },
139
+ }
140
+ )
141
+ })
142
+ _: true
143
+ ) {
144
+ const model = await this.API.post(`/commands/${this.constructor.name}/createModel`, { name, age, about, services, rating, specifications, workerId: context.user.id }).then((res) => res.data)
145
+ return context.redirect(CommandManager.getCommandByName('EscortModelsCommand') as any, { model: model.id })
146
+ }
147
+ })
148
+ }
149
+
150
+ async inlineExecute(context: InlineQueryContext, ...args: any) {}
151
+ }
@@ -0,0 +1,4 @@
1
+ import { CommandContext } from 'evogram';
2
+ export declare class EscortCreateModelCommand extends SharedCommand {
3
+ execute(context: CommandContext, name: string, age: number, about: string, : any): any;
4
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EscortCreateModelCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const migrated_1 = require("evogram/lib/migrated");
6
+ let EscortCreateModelCommand = class EscortCreateModelCommand extends SharedCommand {
7
+ };
8
+ exports.EscortCreateModelCommand = EscortCreateModelCommand;
9
+ exports.EscortCreateModelCommand = EscortCreateModelCommand = tslib_1.__decorate([
10
+ (0, migrated_1.CommandD)({ name: 'escortcreatemodel', backButton: 'К созданию модели' })
11
+ ], EscortCreateModelCommand);
12
+ services: string[],
13
+ ;
14
+ rating: number,
15
+ ;
16
+ specifications: string[],
17
+ ;
18
+ _: true;
19
+ {
20
+ const model = await this.API.post(`/commands/${this.constructor.name}/createModel`, {
21
+ name,
22
+ age,
23
+ about,
24
+ services,
25
+ rating,
26
+ specifications,
27
+ workerId: context.user.id
28
+ }).then((res) => res.data);
29
+ return context.redirect(migrated_1.CommandManager.getCommandByName('EscortModelsCommand'), { model: model.id });
30
+ }
31
+ async;
32
+ inlineExecute(context, migrated_1.InlineQueryContext, ...args, any);
33
+ { }
@@ -0,0 +1,133 @@
1
+ import { CommandArgument, CommandContext } from 'evogram'
2
+ import { CommandD, CommandManager, InlineQueryContext } from 'evogram/lib/migrated'
3
+
4
+ @CommandD({ name: 'escortcreatemodel', backButton: 'К созданию модели' })
5
+ export class EscortCreateModelCommand extends SharedCommand {
6
+ async execute(
7
+ context: CommandContext,
8
+ @CommandArgument({
9
+ name: 'name',
10
+ question: ({ context }) =>
11
+ context
12
+ .sendFormattedQuestion({
13
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
14
+ footer: '<i>Отправьте имя модели в следующем сообщении</i>',
15
+ })
16
+ .then((message) => message.text),
17
+ })
18
+ name: string,
19
+ @CommandArgument({
20
+ name: 'age',
21
+ question: ({ context }) =>
22
+ context
23
+ .sendFormattedQuestion({
24
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
25
+ footer: '<i>Отправьте возраст модели в следующем сообщении (от 18 до 99 лет)</i>',
26
+ })
27
+ .then((message) => message.text),
28
+ })
29
+ age: number,
30
+ @CommandArgument({
31
+ name: 'about',
32
+ question: ({ context }) =>
33
+ context
34
+ .sendFormattedQuestion({
35
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
36
+ footer: '<i>Отправьте описание модели в следующем сообщении (не более 1000 символов)</i>',
37
+ })
38
+ .then((message) => message.text),
39
+ })
40
+ about: string,
41
+ @CommandArgument({
42
+ name: 'services',
43
+ question: ({ context }) =>
44
+ context
45
+ .sendFormattedQuestion({
46
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
47
+ footer: '<i>Отправьте услуги модели в следующем сообщении (через запятую)</i>',
48
+ })
49
+ .then((message) => message.text),
50
+ ({ value }) => value.split(',').map((x) => x.trim()),
51
+ })
52
+ services: string[],
53
+ @CommandArgument({
54
+ name: 'rating',
55
+ question: ({ context }) =>
56
+ context
57
+ .sendFormattedQuestion({
58
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
59
+ footer: '<i>Отправьте рейтинг модели в следующем сообщении (от 0.00 до 5.00)</i>',
60
+ })
61
+ .then((message) => message.text),
62
+ })
63
+ rating: number,
64
+ @CommandArgument({
65
+ name: 'specifications',
66
+ question: ({ context, error }) =>
67
+ context
68
+ .sendFormattedQuestion({
69
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
70
+ footer: '<i>Отправьте спецификации модели в следующем сообщении через запятую (Этническая группа, Телосложение, Цвет волос, Рост, Вес, Грудь)</i>',
71
+ error: error?.message,
72
+ })
73
+ .then((message) => message.text),
74
+ ({ value }) =>
75
+ value
76
+ .split(',')
77
+ .map((x) => x.trim())
78
+ .slice(0, 6),
79
+ ({ value }) => {
80
+ if (value.length < 6) throw new Error('Вы указали не все спецификации')
81
+ else return value
82
+ },
83
+ })
84
+ specifications: string[],
85
+ @CommandArgument('confirm', ({ context, value, validateArgs, args }) => {
86
+ if (value) return value
87
+ console.log({ validateArgs, args })
88
+
89
+ context.sendFormatted(
90
+ {
91
+ header: `<blockquote><b>👱‍♀️ Регистрация новой модели ${validateArgs.name} [${validateArgs.age} лет]</b></blockquote>\n\n` + `<i>${validateArgs.about}</i>`,
92
+ body: [
93
+ {
94
+ title: 'ℹ️ Информация о моделе',
95
+ data: Array.from({ length: validateArgs.specifications.length }, (_, i) => [
96
+ Object.values({
97
+ ethnicity: 'Этническая группа',
98
+ physique: 'Телосложение',
99
+ hair_color: 'Цвет волос',
100
+ height: 'Рост',
101
+ weight: 'Вес',
102
+ breasts: 'Грудь',
103
+ })[i],
104
+ validateArgs.specifications[i],
105
+ ]),
106
+ },
107
+ ],
108
+ footer: `<b>💄 Услуги, входящие в стоимость тарифа:</b> <i>${validateArgs.services.length ? validateArgs.services.join(', ') : '-'}</i>`,
109
+ },
110
+ {
111
+ reply_markup: {
112
+ inline_keyboard: [[{ text: '✅ Подтвердить', command: EscortCreateModelCommand, payload: { ...args, confirm: true } }]],
113
+ },
114
+ }
115
+ )
116
+ })
117
+ _: true
118
+ ) {
119
+ const model = await this.API.post(`/commands/${this.constructor.name}/createModel`, {
120
+ name,
121
+ age,
122
+ about,
123
+ services,
124
+ rating,
125
+ specifications,
126
+ workerId: context.user.id
127
+ }).then((res) => res.data)
128
+
129
+ return context.redirect(CommandManager.getCommandByName('EscortModelsCommand') as any, { model: model.id })
130
+ }
131
+
132
+ async inlineExecute(context: InlineQueryContext, ...args: any) {}
133
+ }
@@ -0,0 +1,4 @@
1
+ export declare class EscortCreateModelCommand extends SharedCommand {
2
+ execute(context: CommandContext, name: string, age: number, about: string, services: string[], rating: number, specifications: string[], _: true): Promise<any>;
3
+ private static createModel;
4
+ }
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EscortCreateModelCommand = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const evogram_1 = require("evogram");
7
+ const migrated_1 = require("evogram/lib/migrated");
8
+ let EscortCreateModelCommand = class EscortCreateModelCommand extends SharedCommand {
9
+ execute(context, name, age, about, services, rating, specifications, _) {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ const model = yield this.API.post(`/commands/${this.constructor.name}/createModel`, { name, age, about, services, rating, specifications, workerId: context.user.id }).then((res) => res.data);
12
+ return context.redirect(migrated_1.CommandManager.getCommandByName('EscortModelsCommand'), { model: model.id });
13
+ });
14
+ }
15
+ static createModel(_a) {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ name, age, about, services, rating, specifications, workerId }) {
17
+ const model = yield ;
18
+ });
19
+ }
20
+ };
21
+ exports.EscortCreateModelCommand = EscortCreateModelCommand;
22
+ tslib_1.__decorate([
23
+ tslib_1.__param(1, (0, evogram_1.CommandArgument)({
24
+ name: 'name',
25
+ question: ({ context }) => context
26
+ .sendFormattedQuestion({
27
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
28
+ footer: '<i>Отправьте имя модели в следующем сообщении</i>',
29
+ })
30
+ .then((message) => message.text),
31
+ }
32
+ // stringValidator({ max: 20 })
33
+ )),
34
+ tslib_1.__param(2, (0, evogram_1.CommandArgument)({
35
+ name: 'age',
36
+ question: ({ context }) => context
37
+ .sendFormattedQuestion({
38
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
39
+ footer: '<i>Отправьте возраст модели в следующем сообщении (от 18 до 99 лет)</i>',
40
+ })
41
+ .then((message) => message.text),
42
+ }
43
+ // numberValidator({ min: 18, max: 99 })
44
+ )),
45
+ tslib_1.__param(3, (0, evogram_1.CommandArgument)({
46
+ name: 'about',
47
+ question: ({ context }) => context
48
+ .sendFormattedQuestion({
49
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
50
+ footer: '<i>Отправьте описание модели в следующем сообщении (не более 1000 символов)</i>',
51
+ })
52
+ .then((message) => message.text),
53
+ }
54
+ // stringValidator({ max: 1000 })
55
+ )),
56
+ tslib_1.__param(4, (0, evogram_1.CommandArgument)({
57
+ name: 'services',
58
+ question: ({ context }) => context
59
+ .sendFormattedQuestion({
60
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
61
+ footer: '<i>Отправьте услуги модели в следующем сообщении (через запятую)</i>',
62
+ })
63
+ .then((message) => message.text),
64
+ },
65
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
66
+ ({ value }) => value.split(',').map((x) => x.trim()))),
67
+ tslib_1.__param(5, (0, evogram_1.CommandArgument)({
68
+ name: 'rating',
69
+ question: ({ context }) => context
70
+ .sendFormattedQuestion({
71
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
72
+ footer: '<i>Отправьте рейтинг модели в следующем сообщении (от 0.00 до 5.00)</i>',
73
+ })
74
+ .then((message) => message.text),
75
+ }
76
+ // numberValidator({ min: 0, max: 5, allowFloat: true })
77
+ )),
78
+ tslib_1.__param(6, (0, evogram_1.CommandArgument)({
79
+ name: 'specifications',
80
+ question: ({ context, error }) => context
81
+ .sendFormattedQuestion({
82
+ header: '<blockquote><b>👱‍♀️ Регистрация новой модели</b></blockquote>',
83
+ footer: `<i>Отправьте спецификации модели в следующем сообщении через запятую (${Object.values({
84
+ ethnicity: 'Этническая группа',
85
+ physique: 'Телосложение',
86
+ hair_color: 'Цвет волос',
87
+ height: 'Рост',
88
+ weight: 'Вес',
89
+ breasts: 'Грудь',
90
+ }).join(', ')})</i>`,
91
+ error: error === null || error === void 0 ? void 0 : error.message,
92
+ })
93
+ .then((message) => message.text),
94
+ },
95
+ // stringValidator({ pattern: /^[а-яА-Яa-zA-Z0-9\s]+(,[а-яА-Яa-zA-Z0-9\s]+)*$/ }),
96
+ ({ value }) => value
97
+ .split(',')
98
+ .map((x) => x.trim())
99
+ .slice(0, 6), ({ value }) => {
100
+ if (value.length < 6)
101
+ throw new Error('Вы указали не все спецификации');
102
+ else
103
+ return value;
104
+ })),
105
+ tslib_1.__param(7, (0, evogram_1.CommandArgument)('confirm', ({ context, value, validateArgs, args }) => {
106
+ if (value)
107
+ return value;
108
+ console.log({ validateArgs, args });
109
+ context.sendFormatted({
110
+ header: `<blockquote><b>👱‍♀️ Регистрация новой модели ${validateArgs.name} [${validateArgs.age} лет]</b></blockquote>\n\n` + `<i>${validateArgs.about}</i>`,
111
+ body: [
112
+ {
113
+ title: 'ℹ️ Информация о моделе',
114
+ data: Array.from({ length: validateArgs.specifications.length }, (_, i) => [
115
+ Object.values({
116
+ ethnicity: 'Этническая группа',
117
+ physique: 'Телосложение',
118
+ hair_color: 'Цвет волос',
119
+ height: 'Рост',
120
+ weight: 'Вес',
121
+ breasts: 'Грудь',
122
+ })[i],
123
+ validateArgs.specifications[i],
124
+ ]),
125
+ },
126
+ ],
127
+ footer: `<b>💄 Услуги, входящие в стоимость тарифа:</b> <i>${validateArgs.services.length ? validateArgs.services.join(', ') : '-'}</i>`,
128
+ }, {
129
+ reply_markup: {
130
+ inline_keyboard: [[{ text: '✅ Подтвердить', command: EscortCreateModelCommand, payload: Object.assign(Object.assign({}, args), { confirm: true }) }]],
131
+ },
132
+ });
133
+ })),
134
+ tslib_1.__metadata("design:type", Function),
135
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof CommandContext !== "undefined" && CommandContext) === "function" ? _a : Object, String, Number, String, Array, Number, Array, Boolean]),
136
+ tslib_1.__metadata("design:returntype", Promise)
137
+ ], EscortCreateModelCommand.prototype, "execute", null);
138
+ exports.EscortCreateModelCommand = EscortCreateModelCommand = tslib_1.__decorate([
139
+ (0, migrated_1.CommandD)({ name: 'escortcreatemodel', backButton: 'К созданию модели' })
140
+ ], EscortCreateModelCommand);
141
+ async;
142
+ inlineExecute(context, migrated_1.InlineQueryContext, ...args, any);
143
+ { }