Skip to content

fix: возвращать главное меню после callback оплаты#53

Merged
fUS1ONd merged 3 commits into
fUS1ONd:mainfrom
xtclovver:fix/payment-keyboard-after-callback
Mar 23, 2026
Merged

fix: возвращать главное меню после callback оплаты#53
fUS1ONd merged 3 commits into
fUS1ONd:mainfrom
xtclovver:fix/payment-keyboard-after-callback

Conversation

@xtclovver
Copy link
Copy Markdown
Collaborator

Summary

  • После callback от Platega (успешная оплата/отмена) кнопки «Проверить оплату» и «Отмена» оставались — бот отправлял сообщение без клавиатуры
  • Теперь callback-уведомления отправляются с userKeyboard (главное меню), состояние ожидания оплаты сбрасывается
  • Добавлен sendSchedulerMessageWithKeyboard для отправки сообщений с клавиатурой из фоновых обработчиков

Test plan

  • make tests — все тесты проходят
  • make fmt — форматирование в порядке

🤖 Generated with Claude Code

xtclovver and others added 2 commits March 23, 2026 22:59
При получении callback от Platega (успешная оплата или отмена) бот
отправлял сообщение без клавиатуры — кнопки «Проверить оплату» и
«Отмена» оставались на месте. Теперь callback-уведомления отправляются
с userKeyboard, а состояние ожидания оплаты сбрасывается.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex фас

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@fUS1ONd
Copy link
Copy Markdown
Owner

fUS1ONd commented Mar 23, 2026

Эахахаэаээа

@codex фас

@fUS1ONd
Copy link
Copy Markdown
Owner

fUS1ONd commented Mar 23, 2026

@codex ничего не сломается если в main такой pr залить?

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa166d79a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/bot/payment.go Outdated
Comment on lines +159 to +160
// Сбрасываем состояние ожидания оплаты
h.bot.userStates.Delete(payment.TelegramID)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop deleting arbitrary user state on payment callbacks

userStates is the global dialog router, not a payment-only flag. handleTextMessage explicitly lets a user leave StateWaitPayment* via any main-menu button (internal/bot/handlers.go:238-240) and then enter another flow such as moderator/admin price changes or broadcasts. If the Platega callback lands after that, this unconditional Delete wipes the new state, so the next message is no longer routed to the in-progress flow. Please only clear StateWaitPaymentMethod / StateWaitPaymentResult here; the same regression is repeated in handleCanceled below.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чё он тебе тут высрал
Я не понимать китайский

Безусловный Delete мог затереть состояние другого flow, если
пользователь уже перешёл в него до прихода callback от Platega.
Теперь состояние удаляется только если оно StateWaitPaymentMethod
или StateWaitPaymentResult.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex фас на последний коммит

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex фас на последний коммит

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

@xtclovver
Copy link
Copy Markdown
Collaborator Author

@claude фас

@fUS1ONd
Copy link
Copy Markdown
Owner

fUS1ONd commented Mar 23, 2026

Вот, ci наконец тесты запустил

@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex фас на последний коммит я сказал

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex фас на последний коммит я сказал

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

@xtclovver
Copy link
Copy Markdown
Collaborator Author

@codex es tev tagad uz operatīvo atmiņu nopīšu, skotina tāda, ātri pēdējo komitu apskatīes

@fUS1ONd
Copy link
Copy Markdown
Owner

fUS1ONd commented Mar 23, 2026

Надоела эта ебатория
Кол выглядит норм, заливаю

@xtclovver
Copy link
Copy Markdown
Collaborator Author

Надоела эта ебатория Кол выглядит норм, заливаю

ща клода попрошу

@fUS1ONd fUS1ONd merged commit bd94a45 into fUS1ONd:main Mar 23, 2026
3 checks passed
@xtclovver
Copy link
Copy Markdown
Collaborator Author

ладна

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants