Compare commits

..

4 Commits

Author SHA1 Message Date
leandrotoledo 32dc05ed36 Fix lines too long 2015-08-19 16:08:03 -03:00
leandrotoledo ba5902c1d4 Fix serialization when message has reply_to_message, new_chat_participant or new_chat_photo #42 2015-08-19 15:41:09 -03:00
Leandro Toledo 80371c9f6e Merge branch 'master' of https://github.com/leandrotoledo/python-telegram-bot 2015-08-17 13:15:41 -03:00
Leandro Toledo a8fd6b5061 Releasing v2.7 2015-08-17 13:15:29 -03:00
4 changed files with 22 additions and 7 deletions
+7
View File
@@ -1,3 +1,10 @@
2015-08-17
Release 2.7
Added support for Voice object and sendVoice method
Due backward compatibility performer or/and title will be required for sendAudio
Fixed JSON serialization when forwared message
2015-08-15
Released 2.6.1
Fixed parsing image header issue on < Python 2.7.3
+1 -1
View File
@@ -15,7 +15,7 @@ def read(*paths):
setup(
name='python-telegram-bot',
version='2.6.1',
version='2.7',
author='Leandro Toledo',
author_email='leandrotoledodesouza@gmail.com',
license='LGPLv3',
+1 -1
View File
@@ -18,7 +18,7 @@
__author__ = 'leandrotoledodesouza@gmail.com'
__version__ = '2.6.1'
__version__ = '2.7'
from .base import TelegramObject
from .user import User
+13 -5
View File
@@ -174,6 +174,13 @@ class Message(TelegramObject):
else:
left_chat_participant = None
if 'new_chat_photo' in data:
from telegram import PhotoSize
new_chat_photo = \
[PhotoSize.de_json(x) for x in data['new_chat_photo']]
else:
new_chat_photo = None
return Message(message_id=data.get('message_id', None),
from_user=from_user,
date=date,
@@ -194,7 +201,7 @@ class Message(TelegramObject):
new_chat_participant=new_chat_participant,
left_chat_participant=left_chat_participant,
new_chat_title=data.get('new_chat_title', None),
new_chat_photo=data.get('new_chat_photo', None),
new_chat_photo=new_chat_photo,
delete_chat_photo=data.get('delete_chat_photo', None),
group_chat_created=data.get('group_chat_created', None))
@@ -218,7 +225,7 @@ class Message(TelegramObject):
if self.forward_from:
data['forward_from'] = self.forward_from.to_dict()
if self.reply_to_message:
data['reply_to_message'] = self.reply_to_message
data['reply_to_message'] = self.reply_to_message.to_dict()
if self.text:
data['text'] = self.text
if self.audio:
@@ -240,13 +247,14 @@ class Message(TelegramObject):
if self.location:
data['location'] = self.location.to_dict()
if self.new_chat_participant:
data['new_chat_participant'] = self.new_chat_participant
data['new_chat_participant'] = self.new_chat_participant.to_dict()
if self.left_chat_participant:
data['left_chat_participant'] = self.left_chat_participant
data['left_chat_participant'] = \
self.left_chat_participant.to_dict()
if self.new_chat_title:
data['new_chat_title'] = self.new_chat_title
if self.new_chat_photo:
data['new_chat_photo'] = self.new_chat_photo
data['new_chat_photo'] = [p.to_dict() for p in self.new_chat_photo]
if self.delete_chat_photo:
data['delete_chat_photo'] = self.delete_chat_photo
if self.group_chat_created: