From 8316a57845874847533b9b79963851f1d38016d9 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Thu, 14 Apr 2016 11:00:33 +0800 Subject: [PATCH] Add type Venue. --- telebot/types.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/telebot/types.py b/telebot/types.py index 7b88e93..25ae282 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -426,6 +426,25 @@ class Location(JsonDeserializable): self.latitude = latitude +class Venue(JsonDeserializable): + @classmethod + def de_json(cls, json_type): + obj = cls.check_json(json_type) + location = obj['location'] + title = obj['title'] + address = obj['address'] + foursquare_id = None + if foursquare_id in obj: + foursquare_id = obj['foursquare_id'] + return cls(location, title, address, foursquare_id) + + def __init__(self, location, title, address, foursquare_id=None): + self.location = location + self.title = title + self.address = address + self.foursquare_id = foursquare_id + + class UserProfilePhotos(JsonDeserializable): @classmethod def de_json(cls, json_string):