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

Parser v2 still cannot unmarshal correctly. #5

Open
c0re100 opened this issue Nov 10, 2021 · 2 comments
Open

Parser v2 still cannot unmarshal correctly. #5

c0re100 opened this issue Nov 10, 2021 · 2 comments

Comments

@c0re100
Copy link

c0re100 commented Nov 10, 2021

It's affecting SearchPublicChat and GetChat method.
Maybe it's same issue like #1

code:

chat, err := client.SearchPublicChat("tg_x64")
if err != nil {
    fmt.Println(err.Error())
    return
}

Error message:
json: cannot unmarshal object into Go struct field .last_message of type tdlib.MessageSender

Reason:
Since a public channel with linked group is allow an user reply without join group,
after SearchPublicChat, we can receive chat JSON like this

        "interaction_info": {
            "@type": "messageInteractionInfo",
            "view_count": 1,
            "forward_count": 1,
            "reply_info": {
                "@type": "messageReplyInfo",
                "reply_count": 1,
                "recent_repliers": [{
                        "@type": "messageSenderUser",
                        "user_id": 123456789
                    }
                ],
                "last_read_inbox_message_id": 0,
                "last_read_outbox_message_id": 0,
                "last_message_id": 1048576
            }
        }

ref: https://github.com/tdlib/td/blob/v1.7.0/td/generate/scheme/td_api.tl#L721

But interaction_info do not have UnmarshalJSON method to handle multiple messageSenderUser, so go-tdlib can't parse correctly and return the error.
It's easy to reproduce on my example code.

@c0re100 c0re100 changed the title Parser v2 still can not unmarshal correctly. Parser v2 still cannot unmarshal correctly. Nov 11, 2021
@c0re100
Copy link
Author

c0re100 commented Dec 18, 2021

Another cannot unmarshal method: SearchStickerSet and affecting all sticker method
json: cannot unmarshal object into Go struct field ClosedVectorPath.thumbnail_outline.commands of type tdlib.VectorPathCommand

Reproduce code:

	set, err := client.SearchStickerSet("SeriaKureru")
	if err != nil {
		fmt.Println(err.Error())
		return
	}

@c0re100
Copy link
Author

c0re100 commented Jan 24, 2022

Another cannot unmarshal method: GetWebPageInstantView
json: cannot unmarshal object into Go struct field .page_blocks of type tdlib.PageBlock

Reproduce code:

	page, err := client.GetWebPageInstantView("https://twitter.com/siragagaga/status/1483043827741249541",  true)
	if err != nil {
		fmt.Println(err.Error())
		return
	}

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

No branches or pull requests

1 participant