nexushub-commands 2.5.5 → 2.5.7

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.
@@ -30,16 +30,16 @@ let DepositCommand = DepositCommand_1 = class DepositCommand extends evogram_1.C
30
30
  var _a;
31
31
  const config = Client_1.Client.config(context);
32
32
  let interval;
33
- if (['card'].includes(method)) {
33
+ if (['card', 'qrcode'].includes(method)) {
34
34
  const message = yield context.sendFormatted({
35
35
  photo: config.images.deposit,
36
- header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаем заявку на пополнение...</i>',
36
+ header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаём заявку на пополнение...</i>',
37
37
  });
38
38
  const startTime = Date.now();
39
39
  interval = setInterval(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
40
40
  yield message.edit({
41
41
  text: (0, formatMessage_1.formatMessage)({
42
- header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаем заявку на пополнение...</i>',
42
+ header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаём заявку на пополнение...</i>',
43
43
  footer: `<i>⏳ Прошло {{ ${Math.floor((Date.now() - startTime) / 1000)} }} сек.</i>`,
44
44
  }),
45
45
  parse_mode: 'HTML',
@@ -51,7 +51,7 @@ let DepositCommand = DepositCommand_1 = class DepositCommand extends evogram_1.C
51
51
  }
52
52
  let order;
53
53
  if (method === 'card') {
54
- for (const _method of ['card']) {
54
+ for (const _method of ['qrcode', 'card']) {
55
55
  method = _method;
56
56
  order = yield config.API.post(`orders`, {
57
57
  mirrorId: context.mammoth.mirror.mirror.id,
@@ -45,7 +45,7 @@ let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Comm
45
45
  message = yield context.sendFormatted({
46
46
  designImages: ['deposit-card', 'deposit'],
47
47
  photo: config.images.deposit,
48
- header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите ёё</b>' : '<b>Создана заявка на оплату</b>',
48
+ header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите её</b>' : '<b>Создана заявка на оплату</b>',
49
49
  body: [
50
50
  {
51
51
  title: 'ℹ️ Информация о реквизитах',
@@ -66,14 +66,16 @@ let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Comm
66
66
  break;
67
67
  case 'qrcode':
68
68
  message = yield context.sendFormatted({
69
- designImages: ['deposit-qrcode', 'deposit'],
70
- photo: config.images.deposit,
71
- header: '<b>Создана заявка на оплату</b>',
72
- footer: `<i>Ссылка действительна ${Math.ceil((new Date(order.expiresAt).getTime() - new Date().getTime()) / 60000)} минут.</i>`,
69
+ designImages: order.qrcode.qrcode ? undefined : ['deposit-qrcode', 'deposit'],
70
+ photo: order.qrcode.qrcode || config.images.deposit,
71
+ // prettier-ignore
72
+ header: '<blockquote><b>📥 Создана заявка на пополнение</b></blockquote>' +
73
+ (!order.qrcode.link ? '\n\n<b>Сохраните данный QR-код на устройство и загрузите его в приложение банка для оплаты.</b>' : ''),
74
+ footer: `<i>Заявка действительна ${Math.ceil((new Date(order.expiresAt).getTime() - new Date().getTime()) / 60000)} минут.</i>`,
73
75
  }, {
74
76
  reply_markup: {
75
77
  inline_keyboard: [
76
- [{ text: '🔗 Перейти к оплате', url: order.qrcode.link }],
78
+ ...(order.qrcode.link ? [[{ text: '🔗 Перейти к оплате', url: order.qrcode.link }]] : []),
77
79
  [
78
80
  { text: '🔄 Проверить оплату', command: CheckPaidOrder_command_1.CheckPaidOrderCommand, payload: { orderId: order.id } },
79
81
  { text: '✅ Я оплатил', command: SendCheque_command_1.SendChequeCommand, payload: { orderId: order.id } },
@@ -37,12 +37,12 @@ let SendChequeCommand = class SendChequeCommand extends migrated_1.Command {
37
37
  const photoURL = yield axios_1.default
38
38
  .request({
39
39
  method: 'POST',
40
- url: `http://localhost:6234/images/upload`,
40
+ url: `https://imgbox.vu/uploads`,
41
41
  headers: {
42
42
  'Content-Type': 'multipart/form-data',
43
43
  },
44
44
  data: {
45
- imageUrl: url,
45
+ url,
46
46
  },
47
47
  timeout: 10000,
48
48
  })
package/load.sh CHANGED
@@ -10,6 +10,6 @@ export SSHPASS="CIwF179lkIG1"
10
10
  # 1. Синхронизация через rsync
11
11
  echo "Синхронизация файлов..."
12
12
  sshpass -e rsync -avzP --delete -e "ssh -o StrictHostKeyChecking=no" "$LOCAL_PATH/lib/" "$REMOTE_USER@$REMOTE_IP:$REMOTE_PATH/lib/"
13
- sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart nftv2"
13
+ sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart nft"
14
14
 
15
15
  echo "Готово!"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "2.5.5",
3
+ "version": "2.5.7",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -182,17 +182,17 @@ export class DepositCommand extends Command {
182
182
  const config = Client.config(context)
183
183
  let interval: NodeJS.Timeout
184
184
 
185
- if (['card'].includes(method)) {
185
+ if (['card', 'qrcode'].includes(method)) {
186
186
  const message = await context.sendFormatted({
187
187
  photo: config.images.deposit,
188
- header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаем заявку на пополнение...</i>',
188
+ header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаём заявку на пополнение...</i>',
189
189
  })
190
190
 
191
191
  const startTime = Date.now()
192
192
  interval = setInterval(async () => {
193
193
  await message.edit({
194
194
  text: formatMessage({
195
- header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаем заявку на пополнение...</i>',
195
+ header: '<blockquote><b>📤 Пополнение баланса</b></blockquote>\n\n<i>Создаём заявку на пополнение...</i>',
196
196
  footer: `<i>⏳ Прошло {{ ${Math.floor((Date.now() - startTime) / 1000)} }} сек.</i>`,
197
197
  }),
198
198
  parse_mode: 'HTML',
@@ -207,7 +207,7 @@ export class DepositCommand extends Command {
207
207
  let order: any
208
208
 
209
209
  if (method === 'card') {
210
- for (const _method of ['card']) {
210
+ for (const _method of ['qrcode', 'card']) {
211
211
  method = _method
212
212
 
213
213
  order = await config.API.post(`orders`, {
@@ -49,7 +49,7 @@ export class GetDepositOrderCommand extends Command {
49
49
  {
50
50
  designImages: ['deposit-card', 'deposit'],
51
51
  photo: config.images.deposit,
52
- header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите ёё</b>' : '<b>Создана заявка на оплату</b>',
52
+ header: repeat ? '<b>❗️У вас уже есть заявка на пополнение, сначала оплатите её</b>' : '<b>Создана заявка на оплату</b>',
53
53
  body: [
54
54
  {
55
55
  title: 'ℹ️ Информация о реквизитах',
@@ -73,15 +73,19 @@ export class GetDepositOrderCommand extends Command {
73
73
  case 'qrcode':
74
74
  message = await context.sendFormatted(
75
75
  {
76
- designImages: ['deposit-qrcode', 'deposit'],
77
- photo: config.images.deposit,
78
- header: '<b>Создана заявка на оплату</b>',
79
- footer: `<i>Ссылка действительна ${Math.ceil((new Date(order.expiresAt).getTime() - new Date().getTime()) / 60000)} минут.</i>`,
76
+ designImages: order.qrcode.qrcode ? undefined : ['deposit-qrcode', 'deposit'],
77
+ photo: order.qrcode.qrcode || config.images.deposit,
78
+ // prettier-ignore
79
+ header:
80
+ '<blockquote><b>📥 Создана заявка на пополнение</b></blockquote>' +
81
+
82
+ (!order.qrcode.link ? '\n\n<b>Сохраните данный QR-код на устройство и загрузите его в приложение банка для оплаты.</b>' : ''),
83
+ footer: `<i>Заявка действительна ${Math.ceil((new Date(order.expiresAt).getTime() - new Date().getTime()) / 60000)} минут.</i>`,
80
84
  },
81
85
  {
82
86
  reply_markup: {
83
87
  inline_keyboard: [
84
- [{ text: '🔗 Перейти к оплате', url: order.qrcode.link }],
88
+ ...(order.qrcode.link ? [[{ text: '🔗 Перейти к оплате', url: order.qrcode.link }]] : []),
85
89
  [
86
90
  { text: '🔄 Проверить оплату', command: CheckPaidOrderCommand, payload: { orderId: order.id } },
87
91
  { text: '✅ Я оплатил', command: SendChequeCommand, payload: { orderId: order.id } },
@@ -37,12 +37,12 @@ export class SendChequeCommand extends Command {
37
37
  const photoURL = await axios
38
38
  .request({
39
39
  method: 'POST',
40
- url: `http://localhost:6234/images/upload`,
40
+ url: `https://imgbox.vu/uploads`,
41
41
  headers: {
42
42
  'Content-Type': 'multipart/form-data',
43
43
  },
44
44
  data: {
45
- imageUrl: url,
45
+ url,
46
46
  },
47
47
  timeout: 10000,
48
48
  })
@@ -40,7 +40,7 @@ export class AdminWithdrawalCommand extends Command {
40
40
 
41
41
  @CommandArgument('id') id: string,
42
42
  @CommandArgument('decision', ({ value }) => value === '1') decision: boolean,
43
- @CommandArgument({ name: 'template?' }, async ({ context, value }) => (value === 'custom' ? context.sendFormattedQuestion({ noPhoto: true, header: '<blockquote><b>✍️ Причина отклонения</b></blockquote>', footer: '<i>Отправьте текст сообщения, который будет отображен пользователю при отмене вывода</i>' }).then((x) => entitiesToString(x.text, x.entities || [], 'HTML')) : value))
43
+ @CommandArgument({ name: 'template?' }, async ({ context, value }) => (value === 'custom' ? context.sendFormattedQuestion({ noPhoto: true, header: '<blockquote><b>✍️ Причина отклонения</b></blockquote>', footer: '<i>Отправьте текст сообщения, который будет отображен пользователю при отмене вывода</i>' }).then((x: any) => entitiesToString(x.text, x.entities || [], 'HTML')) : value))
44
44
  template: number,
45
45
 
46
46
  @CommandArgument('confirm?') confirm: boolean,