Skip to content
New issue

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

fix(client): handle errors when editing inline bot messages #307

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

AndrielFR
Copy link
Contributor

@AndrielFR AndrielFR commented Jan 24, 2025

Fixes the error DC_ID_INVALID that occurs when uploading a tl::enums::InputMedia::PhotoExternal(_) or tl::enums::InputMedia::DocumentExternal(_).

@Lonami
Copy link
Owner

Lonami commented Jan 24, 2025

sometimes appears

Is there no better way to determine when that "sometimes" is?

I'm not entirely happy with the approach here because it is probably being unnecessarily wasteful, and we're doing a catch-all error, which means we may be incorrectly trying to do a second edit.

I haven't heard complaints on this failing from Telethon, and I don't remember it checking for errors like this.

@AndrielFR
Copy link
Contributor Author

sometimes appears

Is there no better way to determine when that "sometimes" is?

I'm not entirely happy with the approach here because it is probably being unnecessarily wasteful, and we're doing a catch-all error, which means we may be incorrectly trying to do a second edit.

I haven't heard complaints on this failing from Telethon, and I don't remember it checking for errors like this.

I dont know, sometimes it works just fine with media, othertimes no, i'll investigate, i guess its related to webpage media, not sure

@AndrielFR
Copy link
Contributor Author

sometimes appears

Is there no better way to determine when that "sometimes" is?

I'm not entirely happy with the approach here because it is probably being unnecessarily wasteful, and we're doing a catch-all error, which means we may be incorrectly trying to do a second edit.

I haven't heard complaints on this failing from Telethon, and I don't remember it checking for errors like this.

Ok, it only occurs with InputMedia::PhotoExternal(_) and InputMedia::DocumentExternal(_).

Refactored the `edit_inline_bot_message` method to properly handle external media types such as `PhotoExternal` and `DocumentExternal`. This ensures that the media is correctly passed to the `EditInlineBotMessage` function.
@AndrielFR AndrielFR force-pushed the fix-edit-inline-message branch from 26ec63a to 0bd1edd Compare January 25, 2025 00:06
@Lonami Lonami merged commit b2ebb36 into Lonami:master Jan 25, 2025
1 check passed
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