From c9b6d3f8681d67969737f0e4eabffbb33c29ff89 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Wed, 22 Feb 2023 09:49:29 +0300 Subject: [PATCH] New content types added + typo fix --- telebot/__init__.py | 2 +- telebot/async_telebot.py | 2 +- telebot/asyncio_helper.py | 4 ++-- telebot/util.py | 9 ++++----- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 46669a6..f8dd488 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -191,7 +191,7 @@ class TeleBot: coloredlogs.install(logger=logger, level=logger.level) except ImportError: raise ImportError( - 'Install colorredlogs module to use colorful_logs option.' + 'Install coloredlogs module to use colorful_logs option.' ) # threading-related diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index d1fa77b..a75398c 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -139,7 +139,7 @@ class AsyncTeleBot: coloredlogs.install(logger=logger, level=logger.level) except ImportError: raise ImportError( - 'Install colorredlogs module to use colorful_logs option.' + 'Install coloredlogs module to use colorful_logs option.' ) # properties diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index 6a92b87..04b494f 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -173,14 +173,14 @@ async def get_file_url(token, file_id): if FILE_URL is None: return "https://api.telegram.org/file/bot{0}/{1}".format(token, (await get_file(token, file_id))['file_path']) else: - # noinspection PyUnresolvedReferences return FILE_URL.format(token, (await get_file(token, file_id))['file_path']) async def download_file(token, file_path): if FILE_URL is None: url = "https://api.telegram.org/file/bot{0}/{1}".format(token, file_path) - else: url = FILE_URL.format(token, file_path) + else: + url = FILE_URL.format(token, file_path) session = await session_manager.get_session() async with session.get(url, proxy=proxy) as response: if response.status != 200: diff --git a/telebot/util.py b/telebot/util.py index 4fa81a3..bcb8428 100644 --- a/telebot/util.py +++ b/telebot/util.py @@ -35,11 +35,10 @@ content_type_media = [ #: Contains all service content types such as `User joined the group`. content_type_service = [ 'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', - 'group_chat_created', - 'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message', - 'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', 'video_chat_ended', - 'video_chat_participants_invited', 'message_auto_delete_timer_changed', 'forum_topic_created', 'forum_topic_closed', - 'forum_topic_reopened', + 'group_chat_created', 'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', + 'migrate_from_chat_id', 'pinned_message', 'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', + 'video_chat_ended', 'video_chat_participants_invited', 'message_auto_delete_timer_changed', 'forum_topic_created', + 'forum_topic_closed', 'forum_topic_reopened', 'user_shared', 'chat_shared', ] #: All update types, should be used for allowed_updates parameter in polling.