TelegramBot / Api

Native PHP Wrapper for Telegram BOT API
MIT License
1.06k stars 324 forks source link

Can't instantiate ForumTopicClosed and ForumTopicReopened #413

Open BoShurik opened 1 year ago

BoShurik commented 1 year ago

While working on #412 found that ForumTopicClosed and ForumTopicReopened always null as there is no additional information.

@bernard-ng can you take a glance?

bernard-ng commented 12 months ago

@BoShurik okay

yes for the moment there is no information in these classes as mentioned in telegram api 6.3, this is a special case

https://core.telegram.org/bots/api#forumtopicclosed https://core.telegram.org/bots/api#forumtopicreopened

ForumTopicReopened This object represents a service message about a forum topic reopened in the chat. Currently holds no information.

ForumTopicClosed This object represents a service message about a forum topic closed in the chat. Currently holds no information.

BoShurik commented 2 months ago

So it's not possible to handle those objects. Any workaround?

bernard-ng commented 2 months ago

for the moment no idea, we'd have to consider this case, whether it's possible to have an empty json {} or instantiate a class that has no property

I could look into this as soon as I've got a bit of time, and run some tests too.