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
Need some help with using object properties in gramjs.
Have message: const message = event.message;
For example, I want to get photo from this message contains photo. Using:
const photo = message.photo; // Expect type Api.InputPhoto, but returns Api.TypeInputPhoto.
//I can use "as Api.InputPhoto"
const photo = messages.photo as Api.InputPhoto;
but if I need to go deeper into properties. I should cast Api.Type* -> Api.* everywhere.
Is any decision without type casting?
The text was updated successfully, but these errors were encountered:
aam1go
changed the title
Use message properties returns Api.TypeInputPhoto instead of Api.InputPhoto for example.
Use message properties returns Api.Type* instead Api.* Is any automatic type conversion or methods to take concrete type
Feb 12, 2024
Need some help with using object properties in gramjs.
Have message:
const message = event.message;
For example, I want to get photo from this message contains photo. Using:
but if I need to go deeper into properties. I should cast Api.Type* -> Api.* everywhere.
Is any decision without type casting?
The text was updated successfully, but these errors were encountered: