Skip to content

Implement Telegram AI assistant with WebApp viewer#1

Open
kukutz wants to merge 1 commit intomainfrom
codex/create-full-featured-telegram-bot-project
Open

Implement Telegram AI assistant with WebApp viewer#1
kukutz wants to merge 1 commit intomainfrom
codex/create-full-featured-telegram-bot-project

Conversation

@kukutz
Copy link
Owner

@kukutz kukutz commented Nov 7, 2025

Summary

  • add aiogram handlers for chat and inline modes, including streaming edits and web-app buttons
  • implement OpenAI streaming client, markdown rendering utilities, and async repository layer
  • expose FastAPI webhook and mini-app with static assets, plus project tooling and documentation

Testing

  • ruff check app tests
  • pytest

Codex Task

Copy link

@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.

ℹ️ 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 on lines +23 to +27
secret_key = hmac.new(
key=b"WebAppData",
msg=settings.telegram_bot_token.encode(),
digestmod=hashlib.sha256,
).digest()

Choose a reason for hiding this comment

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

P1 Badge Use bot token as HMAC key when validating WebApp init data

The WebApp signature validation computes the secret key with hmac.new(key=b"WebAppData", msg=settings.telegram_bot_token.encode(), ...), but Telegram requires the bot token to be the HMAC key and the literal string "WebAppData" to be the message. Because the parameters are swapped, every init payload in production will fail verification and /api/* endpoints will consistently return 401 even for legitimate clients. Swapping the arguments so the bot token is the key will align with Telegram’s spec and allow signed WebApp requests to succeed.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant