Closed saconnolly closed 2 years ago
Optionals parameters are filled only if present generally. pinned_message is a Message object.
Ok then if thats how it should be working there must be an issue with the library or API. Myself and others have both tried to call getChat
on a chat with a pinned_message, but it is not returned. Any ideas?
Have you tried with a bot set as administrator?
Yes
This is the entire object I get back
id: XXX,
title: 'XXX',
type: 'group',
permissions: {
can_send_messages: true,
can_send_media_messages: true,
can_send_polls: true,
can_send_other_messages: true,
can_add_web_page_previews: true,
can_change_info: true,
can_invite_users: true,
can_pin_messages: true
},
all_members_are_administrators: true
}```
The problem is that the field is filled only in supergroups, your group type is group. "getChat now also returns pinned messages in supergroups, if present. Added the new field pinned_message to the Chat object."
I updated to supergroup and its still same
id: XXX,
title: 'XXX',
type: 'supergroup',
permissions: {
can_send_messages: true,
can_send_media_messages: true,
can_send_polls: true,
can_send_other_messages: true,
can_add_web_page_previews: true,
can_change_info: true,
can_invite_users: true,
can_pin_messages: true
}
}
Try with pin a new message when supergroup.
Yep it is working now, thank you so much
but if I want to get back additional properties such as pinned_message, there is not any clear documentation on how to do this and I have tried all the combinations I can think of. How can I make this happen? I assume its with the optional param to getChat, but I can't figure out how that needs to be formatted.