1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

New content types added + typo fix

This commit is contained in:
Badiboy 2023-02-22 09:49:29 +03:00
parent 80c1a4798d
commit c9b6d3f868
4 changed files with 8 additions and 9 deletions

View File

@ -191,7 +191,7 @@ class TeleBot:
coloredlogs.install(logger=logger, level=logger.level) coloredlogs.install(logger=logger, level=logger.level)
except ImportError: except ImportError:
raise ImportError( raise ImportError(
'Install colorredlogs module to use colorful_logs option.' 'Install coloredlogs module to use colorful_logs option.'
) )
# threading-related # threading-related

View File

@ -139,7 +139,7 @@ class AsyncTeleBot:
coloredlogs.install(logger=logger, level=logger.level) coloredlogs.install(logger=logger, level=logger.level)
except ImportError: except ImportError:
raise ImportError( raise ImportError(
'Install colorredlogs module to use colorful_logs option.' 'Install coloredlogs module to use colorful_logs option.'
) )
# properties # properties

View File

@ -173,14 +173,14 @@ async def get_file_url(token, file_id):
if FILE_URL is None: if FILE_URL is None:
return "https://api.telegram.org/file/bot{0}/{1}".format(token, (await get_file(token, file_id))['file_path']) return "https://api.telegram.org/file/bot{0}/{1}".format(token, (await get_file(token, file_id))['file_path'])
else: else:
# noinspection PyUnresolvedReferences
return FILE_URL.format(token, (await get_file(token, file_id))['file_path']) return FILE_URL.format(token, (await get_file(token, file_id))['file_path'])
async def download_file(token, file_path): async def download_file(token, file_path):
if FILE_URL is None: if FILE_URL is None:
url = "https://api.telegram.org/file/bot{0}/{1}".format(token, file_path) 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() session = await session_manager.get_session()
async with session.get(url, proxy=proxy) as response: async with session.get(url, proxy=proxy) as response:
if response.status != 200: if response.status != 200:

View File

@ -35,11 +35,10 @@ content_type_media = [
#: Contains all service content types such as `User joined the group`. #: Contains all service content types such as `User joined the group`.
content_type_service = [ content_type_service = [
'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', 'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo',
'group_chat_created', 'group_chat_created', 'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id',
'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message', 'migrate_from_chat_id', 'pinned_message', 'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started',
'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', 'video_chat_ended', 'video_chat_ended', 'video_chat_participants_invited', 'message_auto_delete_timer_changed', 'forum_topic_created',
'video_chat_participants_invited', 'message_auto_delete_timer_changed', 'forum_topic_created', 'forum_topic_closed', 'forum_topic_closed', 'forum_topic_reopened', 'user_shared', 'chat_shared',
'forum_topic_reopened',
] ]
#: All update types, should be used for allowed_updates parameter in polling. #: All update types, should be used for allowed_updates parameter in polling.