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