telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Proposal: `is_service_message`

Open foremtehan opened this issue 7 months ago • 4 comments

We have over 20+ service message in Message object, isn't good idea to append is_service_message to the object? Similar to: is_topic_message.

foremtehan avatar Apr 11 '25 07:04 foremtehan

Service message is just the name for messages that are sent by Telegram on behalf of users or chats and can't be sent directly. There is no need to differentiate them for processing purposes.

levlam avatar Apr 11 '25 08:04 levlam

There's a situation that i need to use copyMessage on users message, but as the service message cannot be copied i'll get error. So what should i do? to get over it, i have to store all service message's key in my code base to determine is this service message or a normal message.

foremtehan avatar Apr 11 '25 09:04 foremtehan

How would an additional flag help, in this scenario? You would have to save whether a message can be copied or not regardless

RememberTheAir avatar Apr 11 '25 09:04 RememberTheAir

@foremtehan I would use the list of selected message types that should be copied, or just ignore the error. The actual condition is much harder then just "service messages can't be copied".

levlam avatar Apr 11 '25 09:04 levlam