OSCA-Kampala-Chapter / autobot

Autobot is a bot library targetted to build software bots for various platforms with ease of integration in mind
MIT License
14 stars 15 forks source link

Missing InputMessageContent Object #56

Closed kallyas closed 2 years ago

kallyas commented 2 years ago

I have noticed that the InputMessageContent object is missing from the codebase. This is causing problems for our users who are trying to use the InputMessageContent object. I would appreciate it if it could be added to the codebase so that our users can use it. Thank you.

TobiasHT5 commented 2 years ago

@kallyas I cannot find the InputMessageContent object on the telegram bot api page. Where could it be needed?

kallyas commented 2 years ago

InputMessageContent

It is needed by most of InlineQueryResult* Objects with input_message_content as the attribute (optional)

TobiasHT5 commented 2 years ago

@kallyas but it's as if it doesn't have any actual properties inside it, but rather an umbrella for the `InputMessageContent objects. One solution we can use is create it as a base class and have the rest of the objects subclass this. In this way, they type checker might still be able to detect the different subclasses as having a common type. for example

from ..objects import BaseObject

class InputMessageContent (BaseObject):
    pass

class InputTextMessageContent (InputMessageContent):
    # add content here
kallyas commented 2 years ago

This should work for all MessageContents