Closed TobiasHT5 closed 1 year ago
@ushergodwin can you handle this?
Sure, I can. How do you intend to handle required parameters during method implementation?
Check the existence of required parameters in kwargs, then throw an exception if any are missing?
How about having positional required argument, ( can also be *args) and then the optional ones can go in (**kwargs).
Am looking for away that wouldn't involve a lot of processing while validating the method calls.
Let me know what you think.
@ushergodwin we shall delegate the task of checking for required arguments off to telegram. We shall pass on the error raised by telegram to the handler if a request fails. for example, this is an error raised by telegram if we send a message using "sendMessage" but without a message text
{"ok":"false",
"error_code":400,
"description":"Bad Request: message text is empty"
}
@ht-thomas Ohh, okay, that's more convenient. Thanks for the clarification.
The different parameters in all classes in api modules should be removed and replaced with **kwargs. This will help us remove the overhead of constructing a dictionary needed to make api requests. The docstrings and return value can remain the same