Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `ErgoZ Riftbit Vaper <https://github.com/ergoz>`_
- `Eugene Lisitsky <https://github.com/lisitsky>`_
- `franciscod <https://github.com/franciscod>`_
- `Hugo Damer <https://github.com/HakimusGIT>`_
- `Jacob Bom <https://github.com/bomjacob>`_
- `JASON0916 <https://github.com/JASON0916>`_
- `jh0ker <https://github.com/jh0ker>`_
Expand Down
2 changes: 2 additions & 0 deletions telegram/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Animation, Animation).de_json(data, bot)

data['thumb'] = PhotoSize.de_json(data.get('thumb'), bot)

return Animation(**data)
2 changes: 2 additions & 0 deletions telegram/callbackquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def de_json(data, bot):
if not data:
return None

data = super(CallbackQuery, CallbackQuery).de_json(data, bot)

data['from_user'] = User.de_json(data.get('from'), bot)
data['message'] = Message.de_json(data.get('message'), bot)

Expand Down
2 changes: 2 additions & 0 deletions telegram/chatmember.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def de_json(data, bot):
if not data:
return None

data = super(ChatMember, ChatMember).de_json(data, bot)

data['user'] = User.de_json(data.get('user'), bot)

return ChatMember(**data)
3 changes: 2 additions & 1 deletion telegram/choseninlineresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def de_json(data, bot):
if not data:
return None

# Required
data = super(ChosenInlineResult, ChosenInlineResult).de_json(data, bot)
# Required
data['from_user'] = User.de_json(data.pop('from'), bot)
# Optionals
data['location'] = Location.de_json(data.get('location'), bot)
Expand Down
2 changes: 2 additions & 0 deletions telegram/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Document, Document).de_json(data, bot)

data['thumb'] = PhotoSize.de_json(data.get('thumb'), bot)

return Document(**data)
2 changes: 2 additions & 0 deletions telegram/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Game, Game).de_json(data, bot)

data['photo'] = PhotoSize.de_list(data.get('photo'), bot)
data['text_entities'] = MessageEntity.de_list(data.get('text_entities'), bot)
data['animation'] = Animation.de_json(data.get('animation'), bot)
Expand Down
2 changes: 2 additions & 0 deletions telegram/gamehighscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def de_json(data, bot):
if not data:
return None

data = super(GameHighScore, GameHighScore).de_json(data, bot)

data['user'] = User.de_json(data.get('user'), bot)

return GameHighScore(**data)
2 changes: 2 additions & 0 deletions telegram/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Message, Message).de_json(data, bot)

data['from_user'] = User.de_json(data.get('from'), bot)
data['date'] = datetime.fromtimestamp(data['date'])
data['chat'] = Chat.de_json(data.get('chat'), bot)
Expand Down
2 changes: 2 additions & 0 deletions telegram/replykeyboardmarkup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def de_json(data, bot):
if not data:
return None

data = super(ReplyKeyboardMarkup, ReplyKeyboardMarkup).de_json(data, bot)

data['keyboard'] = [KeyboardButton.de_list(keyboard, bot) for keyboard in data['keyboard']]

return ReplyKeyboardMarkup(**data)
Expand Down
2 changes: 2 additions & 0 deletions telegram/sticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Sticker, Sticker).de_json(data, bot)

data['thumb'] = PhotoSize.de_json(data.get('thumb'), bot)

return Sticker(**data)
2 changes: 2 additions & 0 deletions telegram/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Update, Update).de_json(data, bot)

data['message'] = Message.de_json(data.get('message'), bot)
data['edited_message'] = Message.de_json(data.get('edited_message'), bot)
data['inline_query'] = InlineQuery.de_json(data.get('inline_query'), bot)
Expand Down
2 changes: 2 additions & 0 deletions telegram/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def de_json(data, bot):
if not data:
return None

data = super(User, User).de_json(data, bot)

return User(bot=bot, **data)

def get_profile_photos(self, *args, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions telegram/userprofilephotos.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def de_json(data, bot):
if not data:
return None

data = super(UserProfilePhotos, UserProfilePhotos).de_json(data, bot)

data['photos'] = [PhotoSize.de_list(photo, bot) for photo in data['photos']]

return UserProfilePhotos(**data)
Expand Down
4 changes: 2 additions & 2 deletions telegram/utils/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from urllib3.connection import HTTPConnection

from telegram import (InputFile, TelegramError)
from telegram.error import Unauthorized, InvalidToken, NetworkError, TimedOut, BadRequest, \
ChatMigrated, RetryAfter
from telegram.error import (Unauthorized, NetworkError, TimedOut, BadRequest, ChatMigrated,
RetryAfter, InvalidToken)

logging.getLogger('urllib3').setLevel(logging.WARNING)

Expand Down
2 changes: 2 additions & 0 deletions telegram/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def de_json(data, bot):
if not data:
return None

data = super(Video, Video).de_json(data, bot)

data['thumb'] = PhotoSize.de_json(data.get('thumb'), bot)

return Video(**data)
2 changes: 2 additions & 0 deletions telegram/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ def de_json(data, bot):
if not data:
return None

data = super(Voice, Voice).de_json(data, bot)

return Voice(**data)