Skip to content

Commit affae93

Browse files
committed
feat(*): edit info
1 parent 4305339 commit affae93

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bot/commands/keyboard/my_account.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ export const keyboardMyAccount = async (bot, msg, prevMessageForEdit, prevLevel,
1919
const msgId = msg.message_id
2020
const { id } = msg.from
2121

22+
const { dataValues: { tokens, paid_days } } = await db.subscriber.findOne({
23+
where: {
24+
user_id: msg.from.id
25+
}
26+
})
27+
2228
const generalOptions = {
2329
parse_mode: 'HTML',
2430
reply_to_message_id: msgId,
2531
disable_web_page_preview: true
2632
}
2733
try {
28-
const { tokens, paid_days } = await db.subscriber.findOne({
29-
where: {
30-
chat_id: chatId,
31-
user_id: msg.from.id
32-
}
33-
})
3434
const inlineKeyboard = [
3535
[{ text: t('keyboard_buy_subscription'), callback_data: `buy_subscription_A_${msgId}` }],
3636
[{ text: t('keyboard_referral'), callback_data: `referral_program_A_${msgId}` }],
@@ -95,8 +95,8 @@ export const keyboardMyAccount = async (bot, msg, prevMessageForEdit, prevLevel,
9595
).catch(err => console.log(err))
9696
})
9797

98-
eventEmitter.on(`get_first_level_A_${msgId}`, function() {
99-
bot.editMessageText(
98+
eventEmitter.on(`get_first_level_A_${msgId}`, async function() {
99+
await bot.editMessageText(
100100
t('account', { tokens, paid_days }),
101101
{
102102
message_id: accountMessage.message_id,
@@ -218,7 +218,7 @@ Payok - оплачивайте следующими способами:
218218
}).then(res => {
219219
clearTimeout(timeout)
220220
bot.editMessageText(
221-
changeDescription ? changeDescription : t('account'),
221+
changeDescription ? changeDescription : t('account', { tokens, paid_days }),
222222
{
223223
message_id: accountMessage.message_id,
224224
chat_id: chatId,

0 commit comments

Comments
 (0)