Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interface for GetReplyMarkup method to MaybeInaccessibleMessage #217

Open
rezatg opened this issue Oct 31, 2024 · 2 comments
Open

Add interface for GetReplyMarkup method to MaybeInaccessibleMessage #217

rezatg opened this issue Oct 31, 2024 · 2 comments
Assignees
Labels
🔥 Enhancement New feature or request

Comments

@rezatg
Copy link

rezatg commented Oct 31, 2024

Hello,

I would like to suggest adding a new method GetReplyMarkup() to the MaybeInaccessibleMessage interface. This method will allow access to the ReplyMarkup property in the update.CallbackQuery.Message.ReplyMarkup structure. The proposed method will return data of type any to retrieve the ReplyMarkup information.

Objective:
https://github.com/mymmrac/telego/blob/f0e873e1ac8c0bdf50280d3ed972cabfb4473df1/types.go#L925C1-L932C2

Proposed Changes:

  • Add a new method GetReplyMarkup() to the MaybeInaccessibleMessage interface.
  • Define the return type of the method as any to accommodate various data types for ReplyMarkup.

Your consideration and feedback on this proposed enhancement are appreciated. Thank you.

@rezatg rezatg added the 🔥 Enhancement New feature or request label Oct 31, 2024
@mymmrac
Copy link
Owner

mymmrac commented Nov 3, 2024

Hello, I will think about this, but most likely will not add this, since ReplyMarkup may not be present in types, so it's misleading to provide it

@rezatg
Copy link
Author

rezatg commented Nov 3, 2024

Thank you for your response. I understand your concern about the potential absence of ReplyMarkup in some types of messages. However, my suggestion to add the GetReplyMarkup() method is to make access to it easier in cases where ReplyMarkup is present. We can handle this issue by returning a null value or using an optional type (such as a pointer) for cases where ReplyMarkup is not available. This change can provide developers with more flexibility to access ReplyMarkup data when needed.

Furthermore, in most cases, the ReplyMarkup field is present in events of type callback_query :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔥 Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants