mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1927 from Badiboy/master
New content types added + typo fix
This commit is contained in:
commit
6459f13f25
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user