When doing chat.send_message("Hello") the following error occurs:
TypeError: send_message() got multiple values for keyword argument 'chat_id'
This can be solved by providing each argument through its keyword (like that: chat.send_message(text="Hello")), however this is not very convenient.
By replacing keyword argument chat_id=self.id with positional argument self.id (it is the first argument in of the bot.send_message method) in the Chat class, you can avoid to be forced to always use kwargs when calling this method.
The same thing happens for the other shortcut methods (send_photo, send_audio, ...) and for the corresponding methods of the User class.
|
return self.bot.send_message(chat_id=self.id, *args, **kwargs) |