Conversation
c7cf540 to
a56b456
Compare
| return self._api.call("sendContact", args, expect=_objects().Message) | ||
|
|
||
| @_require_api | ||
| def delete_message(self, message): |
There was a problem hiding this comment.
You forgot to add the docstring.
botogram/objects/mixins.py
Outdated
| message = message.message_id | ||
|
|
||
| return self._api.call("deleteMessage", { | ||
| "chat_id": self.id, "message_id": message |
There was a problem hiding this comment.
Can you put all of these on their own line, with a traling comma in all of them?
{
"chat_id": self.id,
"message_id": message,
}
botogram/objects/mixins.py
Outdated
| def delete(self): | ||
| """Delete the message""" | ||
| return self._api.call("deleteMessage", {"chat_id": self.chat.id, | ||
| "message_id": self.message_id}) |
There was a problem hiding this comment.
Use the same style for the parameters as the other method.
|
|
||
| Delete the selected message. | ||
| A message can be deleted only if is sent by the bot or sent in a supergroup by an user where the bot is admin. | ||
|
|
There was a problem hiding this comment.
You forgot to add the versionadded (0.4) and the documentation for the parameter.
|
|
||
| Delete the message self. | ||
| A message can be deleted only if is sent by the bot or sent in a supergroup by an user where the bot is admin. | ||
|
|
There was a problem hiding this comment.
You forgot to add the versionadded (0.4)
|
@pietroalbini Done, it's all ok, right? |
663ce2e to
c5c1262
Compare
|
@pietroalbini Maybe we're ready to merge? |
|
Can you add in the docs that in supergroups it's possibile to delete some service messages? |
c5c1262 to
a6f4efe
Compare
docs/api/telegram.rst
Outdated
|
|
||
| .. py:method:: delete() | ||
|
|
||
| Delete the message self. |
There was a problem hiding this comment.
What? "Delete this message. The message can be deleted only if... It can also be deleted if it's one of the supported service messages."
docs/api/telegram.rst
Outdated
|
|
||
| .. py:method:: delete_message(message) | ||
|
|
||
| Delete the selected message. |
There was a problem hiding this comment.
"Delete the message with the provided ID"
There was a problem hiding this comment.
...or botogram.Message object
a6f4efe to
2ce9f50
Compare
In upcoming Telegram bots API upgrade, bots will able to delete messages sent by itself and sent by users in a supergroup where the bot is admin.
I've added two new methods,
message.delete()andchat.delete_message().Example usage: