From 00f4328bab3c701d72cdd72fb2ba741ff6ba2509 Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Sat, 12 Mar 2016 18:23:14 -0300 Subject: [PATCH 1/8] Remove files from download()' tests on make clean --- Makefile | 1 + 1 file changed, 1 insertion(+) 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 From 8ad34fc3c0bd6f4285b321dd1a853dec5b0871db Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Sat, 12 Mar 2016 19:40:56 -0300 Subject: [PATCH 2/8] Fix InputFile attribute check when from a BufferedReader object --- telegram/inputfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 7a8e84b46ff4cabde8945e1f0c5577e06797dfd0 Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Sat, 12 Mar 2016 20:04:45 -0300 Subject: [PATCH 3/8] Update README.rst --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index cc7dcebb2..19d4deafa 100644 --- a/README.rst +++ b/README.rst @@ -107,6 +107,7 @@ getUpdates Yes getUserProfilePhotos Yes getFile Yes setWebhook Yes +answerInlineQuery Yes ========================= ============ ------------------------- From 3d89f6b2841f721b09e9735484dbd374b151ab06 Mon Sep 17 00:00:00 2001 From: Shelomentsev Dmitriy Date: Sun, 13 Mar 2016 02:15:48 +0300 Subject: [PATCH 4/8] dispatchTelegramCommand no-break space fix. --- telegram/dispatcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram/dispatcher.py b/telegram/dispatcher.py index 3b63500fb..0f57fa223 100644 --- a/telegram/dispatcher.py +++ b/telegram/dispatcher.py @@ -548,7 +548,7 @@ class Dispatcher: command """ - command = update.message.text.split(' ')[0][1:].split('@')[0] + command = update.message.text.decode('utf-8').split()[0][1:].split('@')[0] if command in self.telegram_command_handlers: self.dispatchTo(self.telegram_command_handlers[command], update, From fb34f815331fbfa4ef919eeefe2a9a55475b2948 Mon Sep 17 00:00:00 2001 From: Shelomentsev Dmitriy Date: Sun, 13 Mar 2016 02:27:10 +0300 Subject: [PATCH 5/8] ShelomentsevD added to AUTHORS.rst --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) 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 `_ From 00e2b4815a9c5bd963ae9b82cc162d7990d0c718 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Sun, 13 Mar 2016 12:32:27 +0300 Subject: [PATCH 6/8] Processing commands without casting to UTF-8 --- telegram/dispatcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/dispatcher.py b/telegram/dispatcher.py index 0f57fa223..1e2851843 100644 --- a/telegram/dispatcher.py +++ b/telegram/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.decode('utf-8').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, From 25595e6d9e150a941e5769539cdea27c7f880ae3 Mon Sep 17 00:00:00 2001 From: Leandro Toledo Date: Sun, 13 Mar 2016 19:23:48 -0300 Subject: [PATCH 7/8] Update README.rst Update group link --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 19d4deafa..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 ================= @@ -427,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` From 45a4689fd045447cfe7a7fea6f862febd7b14ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Mon, 14 Mar 2016 09:54:25 +0100 Subject: [PATCH 8/8] update docstrings of Message regarding supergroup conversion --- telegram/message.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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,