nexushub-commands 1.4.0 → 1.4.1

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.
@@ -6,6 +6,7 @@ const evogram_1 = require("evogram");
6
6
  const migrated_1 = require("evogram/lib/migrated");
7
7
  const Client_1 = require("../../Client");
8
8
  const formatMessage_1 = require("../../utils/formatMessage");
9
+ const CheckPaidOrder_command_1 = require("./CheckPaidOrder.command");
9
10
  const GetDepositOrder_command_1 = require("./GetDepositOrder.command");
10
11
  // Функция для маскировки реквизитов: оставляет только последние 4 не пробельных символа
11
12
  function maskExceptLast4(str) {
@@ -117,7 +118,7 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
117
118
  keyboard: [[{ text: '🚀 Оплатить счет', callback_data: `PaidOrderCommand?orderId=${order.id}` }]],
118
119
  });
119
120
  if (Number(deposit) !== Number(order.amount)) {
120
- context.sendFormatted({
121
+ return context.sendFormatted({
121
122
  photo: config.images.deposit,
122
123
  header: `<blockquote><b>ℹ️ Сумма пополнения стала выше</b></blockquote>\n\n<i>Для определения вашего пополнения в системе, Вам придется заплатить ${Number(order.amount).toLocaleString('ru')} ${order.currency.toUpperCase()}. Приносим свои извинения за неудобства</i>`,
123
124
  }, {
@@ -137,7 +138,11 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
137
138
  return;
138
139
  context.client.api.deleteMessage({ chat_id: msgInfo.value.chatId, message_id: msgInfo.value.messageId });
139
140
  context.sendFormatted({
140
- 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>`,
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
+ },
141
146
  });
142
147
  }), new Date(order.expiresAt).getTime() - new Date().getTime());
143
148
  context.redirect(GetDepositOrder_command_1.GetDepositOrderCommand, { orderId: order.id });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -2,6 +2,7 @@ import { Command, CommandArgument, CommandD, numberValidator } from 'evogram';
2
2
  import { CommandContext } from 'evogram/lib/migrated';
3
3
  import { Client } from '../../Client';
4
4
  import { formatMessage } from '../../utils/formatMessage';
5
+ import { CheckPaidOrderCommand } from './CheckPaidOrder.command';
5
6
  import { GetDepositOrderCommand } from './GetDepositOrder.command';
6
7
 
7
8
  // Функция для маскировки реквизитов: оставляет только последние 4 не пробельных символа
@@ -269,7 +270,7 @@ export class DepositCommand extends Command {
269
270
  );
270
271
 
271
272
  if (Number(deposit) !== Number(order.amount)) {
272
- context.sendFormatted(
273
+ return context.sendFormatted(
273
274
  {
274
275
  photo: config.images.deposit,
275
276
  header: `<blockquote><b>ℹ️ Сумма пополнения стала выше</b></blockquote>\n\n<i>Для определения вашего пополнения в системе, Вам придется заплатить ${Number(
@@ -294,7 +295,11 @@ export class DepositCommand extends Command {
294
295
 
295
296
  context.client.api.deleteMessage({ chat_id: msgInfo.value.chatId, message_id: msgInfo.value.messageId });
296
297
  context.sendFormatted({
297
- header: `<blockquote>⚠️ Время на оплату прошло</blockquote>\n\n<i>Мы не получили пополнение по нашим реквизитам. Они больше недоступны для пополнения</i>\n\n<b>ℹ️ Если Вы оплатили, а система не определила Ваш перевод - <a href="t.me/${context.mirror.projectMirror.design.supportBot?.username}">обратитесь в тех. поддержку</a></b>`,
298
+ photo: config.images.deposit,
299
+ header: `<blockquote>⚠️ Время на оплату истекло</blockquote>\n\n<i>Мы не получили пополнение по нашим реквизитам. Они больше недоступны для пополнения</i>\n\n<b>ℹ️ Если Вы оплатили, а система не определила Ваш перевод - <a href="t.me/${context.mirror.projectMirror.design.supportBot?.username}">обратитесь в тех. поддержку</a></b>`,
300
+ reply_markup: {
301
+ inline_keyboard: [[{ text: '🔄 Проверить оплату', command: CheckPaidOrderCommand, payload: { orderId: order.id } }]],
302
+ },
298
303
  });
299
304
  }, new Date(order.expiresAt).getTime() - new Date().getTime());
300
305