You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
services/my-secret-thing/index.go:60:11: cannot use peer (variable of type *tg.ContactsResolvedPeer) as type tg.InputPeerClass in struct literal:
*tg.ContactsResolvedPeer does not implement tg.InputPeerClass (missing construct method)
What Go version and environment are you using?
Go version: go1.18.8 linux/amd64
The text was updated successfully, but these errors were encountered:
Lebed-kun
changed the title
Help! Cannot use peer retrieved from ContactsResolveUsername, as an argument to MessagesGetHistory
Cannot use peer retrieved from ContactsResolveUsername, as an argument to MessagesGetHistory
Nov 19, 2022
This is not a bug in the library, the approach is wrong. You need to use the data retrieved from tg.ContactsResolvedPeer and fill it in tg.InputPeerClass to make it work.
Though Go's linter didn't give me a hint that I was using mismatched type;
What version of gotd are you using?
0.71.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
I tried to compile this code:
What did you expect to see?
I expect successful compilation;
What did you see instead?
An error of type mismatch:
What Go version and environment are you using?
Go version: go1.18.8 linux/amd64
The text was updated successfully, but these errors were encountered: