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: Voice response cannot be decoded #8

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

vorlif
Copy link
Contributor

@vorlif vorlif commented Feb 11, 2025

Fix: The response for an API voice call cannot be decoded because the message ID is a number and not a string.

I replaced the string with an int64 value and added tests based on the API documentation to make sure everything works.

@@ -25,7 +26,7 @@ type Voice struct {
type VoiceMessage struct {
Error *string `json:"error"`
ErrorText *string `json:"error_text"`
Id *string `json:"id"`
Id *int64 `json:"id"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was unsure how large the value could be. If it is a database ID, I can imagine that it will be quite high, which is why I chose int64.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vorlif it is supposed to become quite high indeed, so int64 seems good to me :-)

@vorlif vorlif marked this pull request as draft February 12, 2025 09:10
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