From 71c49fd08b7413d91c8e927ac57bb04261030e7f Mon Sep 17 00:00:00 2001 From: Alex RootJunior Date: Tue, 16 Apr 2019 00:22:22 +0300 Subject: [PATCH] Small changes --- aiogram/bot/api.py | 8 +++----- aiogram/bot/bot.py | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/aiogram/bot/api.py b/aiogram/bot/api.py index 16dbb9fa..051ae37f 100644 --- a/aiogram/bot/api.py +++ b/aiogram/bot/api.py @@ -147,7 +147,7 @@ class Methods(Helper): """ Helper for Telegram API Methods listed on https://core.telegram.org/bots/api - List is updated to Bot API 4.1 + List is updated to Bot API 4.2 """ mode = HelperMode.lowerCamelCase @@ -174,6 +174,7 @@ class Methods(Helper): STOP_MESSAGE_LIVE_LOCATION = Item() # stopMessageLiveLocation SEND_VENUE = Item() # sendVenue SEND_CONTACT = Item() # sendContact + SEND_POLL = Item() # sendPoll SEND_CHAT_ACTION = Item() # sendChatAction GET_USER_PROFILE_PHOTOS = Item() # getUserProfilePhotos GET_FILE = Item() # getFile @@ -202,6 +203,7 @@ class Methods(Helper): EDIT_MESSAGE_CAPTION = Item() # editMessageCaption EDIT_MESSAGE_MEDIA = Item() # editMessageMedia EDIT_MESSAGE_REPLY_MARKUP = Item() # editMessageReplyMarkup + STOP_POLL = Item() # stopPoll DELETE_MESSAGE = Item() # deleteMessage # Stickers @@ -229,10 +231,6 @@ class Methods(Helper): SET_GAME_SCORE = Item() # setGameScore GET_GAME_HIGH_SCORES = Item() # getGameHighScores - # Polls - SEND_POLL = Item() - STOP_POLL = Item() - @staticmethod def api_url(token, method): """ diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index 0e13d62b..c47c9232 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -1585,15 +1585,14 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): async def delete_message(self, chat_id: typing.Union[base.Integer, base.String], message_id: base.Integer) -> base.Boolean: """ - Use this method to delete a message, including service messages, with the following limitations + Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago. - - Bots can delete outgoing messages in groups and supergroups. + - Bots can delete outgoing messages in private chats, groups, and supergroups. + - Bots can delete incoming messages in private chats. - Bots granted can_post_messages permissions can delete outgoing messages in channels. - If the bot is an administrator of a group, it can delete any message there. - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. - The following methods and objects allow your bot to handle stickers and sticker sets. - Source: https://core.telegram.org/bots/api#deletemessage :param chat_id: Unique identifier for the target chat or username of the target channel