diff --git a/AUTHORS.rst b/AUTHORS.rst index 4ba404d5f..ac0ce5718 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -23,6 +23,7 @@ The following wonderful people contributed directly or indirectly to this projec - `Noam Meltzer `_ - `Oleg Shlyazhko `_ - `Rahiel Kasim `_ +- `Shelomentsev D `_ - `sooyhwang `_ - `wjt `_ diff --git a/Makefile b/Makefile index 304d284cb..ec6be9b15 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ clean: find . -name '*.pyc' -exec rm -f {} \; find . -name '*.pyo' -exec rm -f {} \; find . -name '*~' -exec rm -f {} \; + find . -regex "./telegram.\(mp3\|mp4\|ogg\|png\|webp\)" -exec rm {} \; pep257: $(PEP257) telegram diff --git a/README.rst b/README.rst index cc7dcebb2..3a79ad42c 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,7 @@ A Python wrapper around the Telegram Bot API. :alt: Coveralls .. image:: https://img.shields.io/badge/Telegram-Group-blue.svg - :target: https://telegram.me/joinchat/ALnA-D1qVhg60vc-BgZYgA + :target: https://telegram.me/pythontelegrambotgroup :alt: Telegram Group ================= @@ -107,6 +107,7 @@ getUpdates Yes getUserProfilePhotos Yes getFile Yes setWebhook Yes +answerInlineQuery Yes ========================= ============ ------------------------- @@ -426,7 +427,7 @@ You may copy, distribute and modify the software provided that modifications are _`Contact` ========== -Feel free to join to our `Telegram group `_. +Feel free to join to our `Telegram group `_. ======= _`TODO` diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index a5be8c82d..a42087f39 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -23,7 +23,7 @@ import logging from functools import wraps from inspect import getargspec from threading import Thread, BoundedSemaphore, Lock, Event, current_thread -from re import match +from re import match, split from time import sleep from telegram import (TelegramError, Update, NullHandler) @@ -548,7 +548,7 @@ class Dispatcher: command """ - command = update.message.text.split(' ')[0][1:].split('@')[0] + command = split('\W', update.message.text[1:])[0] if command in self.telegram_command_handlers: self.dispatchTo(self.telegram_command_handlers[command], update, diff --git a/telegram/inputfile.py b/telegram/inputfile.py index 8c90a0ad6..c2070b38b 100644 --- a/telegram/inputfile.py +++ b/telegram/inputfile.py @@ -81,7 +81,8 @@ class InputFile(object): self.input_file_content = self.input_file.read() if 'filename' in data: self.filename = self.data.pop('filename') - elif isinstance(self.input_file, file): + elif isinstance(self.input_file, file) and \ + hasattr(self.input_file, 'name'): self.filename = os.path.basename(self.input_file.name) elif from_url: self.filename = os.path.basename(self.input_file.url)\ @@ -134,7 +135,7 @@ class InputFile(object): form_boundary, 'Content-Disposition: form-data; name="%s"; filename="%s"' % ( self.input_name, self.filename - ), + ), 'Content-Type: %s' % self.mimetype, '', self.input_file_content diff --git a/telegram/message.py b/telegram/message.py index bea037b1e..14541fcc8 100644 --- a/telegram/message.py +++ b/telegram/message.py @@ -56,6 +56,10 @@ class Message(TelegramObject): new_chat_photo (List[:class:`telegram.PhotoSize`]): delete_chat_photo (bool): group_chat_created (bool): + supergroup_chat_created (bool): + migrate_to_chat_id (int): + migrate_from_chat_id (int): + channel_chat_created (bool): Args: message_id (int): @@ -84,6 +88,10 @@ class Message(TelegramObject): new_chat_photo (Optional[List[:class:`telegram.PhotoSize`]): delete_chat_photo (Optional[bool]): group_chat_created (Optional[bool]): + supergroup_chat_created (Optional[bool]): + migrate_to_chat_id (Optional[int]): + migrate_from_chat_id (Optional[int]): + channel_chat_created (Optional[bool]): """ def __init__(self,