We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to get callback query data but typescript keep showing error data is doesn't exist
... (ctx) => { const data = ctx.callbackQuery?.data.split(':')[1] console.log(data) }
export DEBUG='telegraf:*'
Please include any relevant log snippets or files here.
The text was updated successfully, but these errors were encountered:
i have the same problem
Sorry, something went wrong.
Since callbackQuery can be a data or game callback, you need to narrow it.
import { callbackQuery } from "telegraf/filters"; // later if (ctx.has(callbackQuery("data")) { const [ data ] = ctx.callbackQuery.data.split(":"); // ... }
@MKRhere Thanks a lot for your help. This solved my problem.
Could you please tell me where I can read about such nuances in the package documentation? I can't find such information
A lot of these nuances are only currently documented in https://github.com/telegraf/telegraf/releases. You can also follow releases on https://t.me/Telegraf_JS
No branches or pull requests
Context
I'm trying to get callback query data but typescript keep showing error data is doesn't exist
Minimal Example Code Reproducing the Issue
Expected Behavior
Current Behavior
Error Message and Logs (
export DEBUG='telegraf:*'
)The text was updated successfully, but these errors were encountered: