-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bot API 9.2 #2511
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
Bot API 9.2 #2511
Changes from 1 commit
9a58fda
54b41ed
c29dd9a
a848089
0df1757
1f6c6d9
9a44dba
5bd1537
181a152
2400f25
6f88714
5ab5056
3fad50d
d3d7a52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2008,6 +2008,51 @@ def copy_message( | |
| video_start_timestamp=video_start_timestamp, direct_messages_topic_id=direct_messages_topic_id, | ||
| suggested_post_parameters=suggested_post_parameters | ||
| )) | ||
|
|
||
|
|
||
| def approve_suggested_post(self, chat_id: Union[int, str], message_id: int, send_date: Optional[int]=None) -> bool: | ||
| """ | ||
| Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success. | ||
|
|
||
| Telegram documentation: https://core.telegram.org/bots/api#approvesuggestedpost | ||
|
|
||
| :param chat_id: Unique identifier for the target direct messages chat | ||
|
Badiboy marked this conversation as resolved.
|
||
| :type chat_id: :obj:`int` or :obj:`str` | ||
|
|
||
| :param message_id: Identifier of a suggested post message to approve | ||
| :type message_id: :obj:`int` | ||
|
|
||
| :param send_date: Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. | ||
| If specified, then the date must be not more than 2678400 seconds (30 days) in the future | ||
| :type send_date: :obj:`int` | ||
|
|
||
| :return: Returns True on success. | ||
| :rtype: :obj:`bool` | ||
| """ | ||
| return apihelper.approve_suggested_post(self.token, chat_id, message_id, | ||
| send_date=send_date) | ||
|
|
||
| def decline_suggested_post(self, chat_id: Union[int, str], message_id: int, comment: Optional[str]=None) -> bool: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for chat/int here. |
||
| """ | ||
| Use this method to decline a suggested post in a direct messages chat. The bot must have | ||
| the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success. | ||
|
|
||
| Telegram documentation: https://core.telegram.org/bots/api#declinesuggestedpost | ||
|
|
||
| :param chat_id: Unique identifier for the target direct messages chat | ||
| :type chat_id: :obj:`int` or :obj:`str` | ||
|
|
||
| :param message_id: Identifier of a suggested post message to decline | ||
| :type message_id: :obj:`int` | ||
|
|
||
| :param comment: Comment for the creator of the suggested post; 0-128 characters | ||
| :type comment: :obj:`str` | ||
|
|
||
| :return: Returns True on success. | ||
| :rtype: :obj:`bool` | ||
| """ | ||
| return apihelper.decline_suggested_post(self.token, chat_id, message_id, | ||
| comment=comment) | ||
|
|
||
| def delete_message(self, chat_id: Union[int, str], message_id: int, | ||
| timeout: Optional[int]=None) -> bool: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3536,6 +3536,50 @@ async def copy_message( | |
| direct_messages_topic_id=direct_messages_topic_id, suggested_post_parameters=suggested_post_parameters | ||
| ) | ||
| ) | ||
|
|
||
| async def approve_suggested_post(self, chat_id: Union[int, str], message_id: int, send_date: Optional[int]=None) -> bool: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chat/int |
||
| """ | ||
| Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success. | ||
|
|
||
| Telegram documentation: https://core.telegram.org/bots/api#approvesuggestedpost | ||
|
|
||
| :param chat_id: Unique identifier for the target direct messages chat | ||
| :type chat_id: :obj:`int` or :obj:`str` | ||
|
|
||
| :param message_id: Identifier of a suggested post message to approve | ||
| :type message_id: :obj:`int` | ||
|
|
||
| :param send_date: Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. | ||
| If specified, then the date must be not more than 2678400 seconds (30 days) in the future | ||
| :type send_date: :obj:`int` | ||
|
|
||
| :return: Returns True on success. | ||
| :rtype: :obj:`bool` | ||
| """ | ||
| return await asyncio_helper.approve_suggested_post(self.token, chat_id, message_id, | ||
| send_date=send_date) | ||
|
|
||
| async def decline_suggested_post(self, chat_id: Union[int, str], message_id: int, comment: Optional[str]=None) -> bool: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chat/int |
||
| """ | ||
| Use this method to decline a suggested post in a direct messages chat. The bot must have | ||
| the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success. | ||
|
|
||
| Telegram documentation: https://core.telegram.org/bots/api#declinesuggestedpost | ||
|
|
||
| :param chat_id: Unique identifier for the target direct messages chat | ||
| :type chat_id: :obj:`int` or :obj:`str` | ||
|
|
||
| :param message_id: Identifier of a suggested post message to decline | ||
| :type message_id: :obj:`int` | ||
|
|
||
| :param comment: Comment for the creator of the suggested post; 0-128 characters | ||
| :type comment: :obj:`str` | ||
|
|
||
| :return: Returns True on success. | ||
| :rtype: :obj:`bool` | ||
| """ | ||
| return await asyncio_helper.decline_suggested_post(self.token, chat_id, message_id, | ||
| comment=comment) | ||
|
|
||
| async def delete_message(self, chat_id: Union[int, str], message_id: int, | ||
| timeout: Optional[int]=None) -> bool: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chat_id: Union[int, str] - Integer only.