nexushub-commands 1.4.1 → 1.4.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.
- package/lib/commands/deposit/Deposit.command.js +18 -18
- package/lib/commands/deposit/GetDepositOrder.command.d.ts +1 -1
- package/lib/commands/deposit/GetDepositOrder.command.js +4 -3
- package/package.json +1 -1
- package/src/commands/deposit/Deposit.command.ts +16 -16
- package/src/commands/deposit/GetDepositOrder.command.ts +2 -2
|
@@ -127,25 +127,25 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
|
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
+
setTimeout(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
var _a;
|
|
132
|
+
const neworder = yield config.API.get(`/orders/${order.id}`).then((x) => x.data);
|
|
133
|
+
if (['paid', 'fakepaid'].includes(neworder.status) || neworder.cheque)
|
|
134
|
+
return;
|
|
135
|
+
const msgInfo = yield context.client.database.config.get(`order${order.id}`);
|
|
136
|
+
if (!msgInfo)
|
|
137
|
+
return;
|
|
138
|
+
context.client.api.deleteMessage({ chat_id: msgInfo.value.chatId, message_id: msgInfo.value.messageId });
|
|
139
|
+
context.sendFormatted({
|
|
140
|
+
photo: config.images.deposit,
|
|
141
|
+
header: `<blockquote><b>⚠️ Время на оплату истекло</b></blockquote>\n\n<i>Мы не получили пополнение по нашим реквизитам. Они больше недоступны для пополнения</i>\n\n<b>ℹ️ Если Вы оплатили, а система не определила Ваш перевод - <a href="t.me/${(_a = context.mirror.projectMirror.design.supportBot) === null || _a === void 0 ? void 0 : _a.username}">обратитесь в тех. поддержку</a></b>`,
|
|
142
|
+
reply_markup: {
|
|
143
|
+
inline_keyboard: [[{ text: '🔄 Проверить оплату', command: CheckPaidOrder_command_1.CheckPaidOrderCommand, payload: { orderId: order.id } }]],
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
}), new Date(order.expiresAt).getTime() - new Date().getTime());
|
|
130
147
|
}
|
|
131
|
-
|
|
132
|
-
var _a;
|
|
133
|
-
const neworder = yield config.API.get(`/orders/${order.id}`).then((x) => x.data);
|
|
134
|
-
if (['paid', 'fakepaid'].includes(neworder.status) || neworder.cheque)
|
|
135
|
-
return;
|
|
136
|
-
const msgInfo = yield context.client.database.config.get(`order${order.id}`);
|
|
137
|
-
if (!msgInfo)
|
|
138
|
-
return;
|
|
139
|
-
context.client.api.deleteMessage({ chat_id: msgInfo.value.chatId, message_id: msgInfo.value.messageId });
|
|
140
|
-
context.sendFormatted({
|
|
141
|
-
photo: config.images.deposit,
|
|
142
|
-
header: `<blockquote>⚠️ Время на оплату истекло</blockquote>\n\n<i>Мы не получили пополнение по нашим реквизитам. Они больше недоступны для пополнения</i>\n\n<b>ℹ️ Если Вы оплатили, а система не определила Ваш перевод - <a href="t.me/${(_a = context.mirror.projectMirror.design.supportBot) === null || _a === void 0 ? void 0 : _a.username}">обратитесь в тех. поддержку</a></b>`,
|
|
143
|
-
reply_markup: {
|
|
144
|
-
inline_keyboard: [[{ text: '🔄 Проверить оплату', command: CheckPaidOrder_command_1.CheckPaidOrderCommand, payload: { orderId: order.id } }]],
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
}), new Date(order.expiresAt).getTime() - new Date().getTime());
|
|
148
|
-
context.redirect(GetDepositOrder_command_1.GetDepositOrderCommand, { orderId: order.id });
|
|
148
|
+
context.redirect(GetDepositOrder_command_1.GetDepositOrderCommand, { orderId: order.id, repeat: order.isRepeat });
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
const wallets = (yield config.API.get('/crypto/wallets')).data.filter((x) => x.isActive);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'evogram';
|
|
2
2
|
import { CommandContext } from 'evogram/lib/migrated';
|
|
3
3
|
export declare class GetDepositOrderCommand extends Command {
|
|
4
|
-
execute(context: CommandContext, orderId: string): Promise<void>;
|
|
4
|
+
execute(context: CommandContext, orderId: string, repeat?: boolean): Promise<void>;
|
|
5
5
|
}
|
|
@@ -8,7 +8,7 @@ const Client_1 = require("../../Client");
|
|
|
8
8
|
const CheckPaidOrder_command_1 = require("./CheckPaidOrder.command");
|
|
9
9
|
const SendCheque_command_1 = require("./SendCheque.command");
|
|
10
10
|
let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Command {
|
|
11
|
-
execute(context, orderId) {
|
|
11
|
+
execute(context, orderId, repeat) {
|
|
12
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
13
|
const config = Client_1.Client.config(context);
|
|
14
14
|
const order = yield config.API.get(`/orders/${orderId}`)
|
|
@@ -48,7 +48,7 @@ let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Comm
|
|
|
48
48
|
case 'card':
|
|
49
49
|
message = yield context.sendFormatted({
|
|
50
50
|
photo: config.images.deposit,
|
|
51
|
-
header:
|
|
51
|
+
header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите ёё</b>' : '<b>Создана заявка на оплату</b>',
|
|
52
52
|
body: [
|
|
53
53
|
{
|
|
54
54
|
title: 'ℹ️ Информация о реквизитах',
|
|
@@ -96,8 +96,9 @@ let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Comm
|
|
|
96
96
|
exports.GetDepositOrderCommand = GetDepositOrderCommand;
|
|
97
97
|
tslib_1.__decorate([
|
|
98
98
|
tslib_1.__param(1, (0, evogram_1.CommandArgument)('orderId')),
|
|
99
|
+
tslib_1.__param(2, (0, evogram_1.CommandArgument)('repeat?')),
|
|
99
100
|
tslib_1.__metadata("design:type", Function),
|
|
100
|
-
tslib_1.__metadata("design:paramtypes", [migrated_1.CommandContext, String]),
|
|
101
|
+
tslib_1.__metadata("design:paramtypes", [migrated_1.CommandContext, String, Boolean]),
|
|
101
102
|
tslib_1.__metadata("design:returntype", Promise)
|
|
102
103
|
], GetDepositOrderCommand.prototype, "execute", null);
|
|
103
104
|
exports.GetDepositOrderCommand = GetDepositOrderCommand = tslib_1.__decorate([
|
package/package.json
CHANGED
|
@@ -284,26 +284,26 @@ export class DepositCommand extends Command {
|
|
|
284
284
|
}
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
|
-
}
|
|
288
287
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
setTimeout(async () => {
|
|
289
|
+
const neworder = await config.API.get(`/orders/${order.id}`).then((x) => x.data);
|
|
290
|
+
if (['paid', 'fakepaid'].includes(neworder.status) || neworder.cheque) return;
|
|
292
291
|
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
const msgInfo = await context.client.database.config.get(`order${order.id}`);
|
|
293
|
+
if (!msgInfo) return;
|
|
295
294
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
295
|
+
context.client.api.deleteMessage({ chat_id: msgInfo.value.chatId, message_id: msgInfo.value.messageId });
|
|
296
|
+
context.sendFormatted({
|
|
297
|
+
photo: config.images.deposit,
|
|
298
|
+
header: `<blockquote><b>⚠️ Время на оплату истекло</b></blockquote>\n\n<i>Мы не получили пополнение по нашим реквизитам. Они больше недоступны для пополнения</i>\n\n<b>ℹ️ Если Вы оплатили, а система не определила Ваш перевод - <a href="t.me/${context.mirror.projectMirror.design.supportBot?.username}">обратитесь в тех. поддержку</a></b>`,
|
|
299
|
+
reply_markup: {
|
|
300
|
+
inline_keyboard: [[{ text: '🔄 Проверить оплату', command: CheckPaidOrderCommand, payload: { orderId: order.id } }]],
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
}, new Date(order.expiresAt).getTime() - new Date().getTime());
|
|
304
|
+
}
|
|
305
305
|
|
|
306
|
-
context.redirect(GetDepositOrderCommand, { orderId: order.id });
|
|
306
|
+
context.redirect(GetDepositOrderCommand, { orderId: order.id, repeat: order.isRepeat });
|
|
307
307
|
} else {
|
|
308
308
|
const wallets = (await config.API.get('/crypto/wallets')).data.filter((x: any) => x.isActive);
|
|
309
309
|
|
|
@@ -6,7 +6,7 @@ import { SendChequeCommand } from './SendCheque.command';
|
|
|
6
6
|
|
|
7
7
|
@CommandD({ name: 'getDepositOrder', backButton: 'К пополнению' })
|
|
8
8
|
export class GetDepositOrderCommand extends Command {
|
|
9
|
-
public async execute(context: CommandContext, @CommandArgument('orderId') orderId: string) {
|
|
9
|
+
public async execute(context: CommandContext, @CommandArgument('orderId') orderId: string, @CommandArgument('repeat?') repeat?: boolean) {
|
|
10
10
|
const config = Client.config(context);
|
|
11
11
|
const order = await config.API.get(`/orders/${orderId}`)
|
|
12
12
|
.then((x) => x.data)
|
|
@@ -51,7 +51,7 @@ export class GetDepositOrderCommand extends Command {
|
|
|
51
51
|
message = await context.sendFormatted(
|
|
52
52
|
{
|
|
53
53
|
photo: config.images.deposit,
|
|
54
|
-
header:
|
|
54
|
+
header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите ёё</b>' : '<b>Создана заявка на оплату</b>',
|
|
55
55
|
body: [
|
|
56
56
|
{
|
|
57
57
|
title: 'ℹ️ Информация о реквизитах',
|