| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -754,23 +754,28 @@ def de_json(cls, json_type): | |||
| 754 | 754 | obj = cls.check_json(json_type) | |
| 755 | 755 | id = obj['id'] | |
| 756 | 756 | from_user = User.de_json(obj['from']) | |
| 757 | + location = None | ||
| 758 | + if 'location' in obj: | ||
| 759 | + location = Location.de_json(obj['location']) | ||
| 757 | 760 | query = obj['query'] | |
| 758 | 761 | offset = obj['offset'] | |
| 759 | - return cls(id, from_user, query, offset) | ||
| 762 | + return cls(id, from_user, location, query, offset) | ||
| 760 | 763 | ||
| 761 | - def __init__(self, id, from_user, query, offset): | ||
| 764 | + def __init__(self, id, from_user, location, query, offset): | ||
| 762 | 765 | """ | |
| 763 | 766 | This object represents an incoming inline query. | |
| 764 | 767 | When the user sends an empty query, your bot could | |
| 765 | 768 | return some default or trending results. | |
| 766 | 769 | :param id: string Unique identifier for this query | |
| 767 | 770 | :param from_user: User Sender | |
| 771 | + :param location: Sender location, only for bots that request user location | ||
| 768 | 772 | :param query: String Text of the query | |
| 769 | 773 | :param offset: String Offset of the results to be returned, can be controlled by the bot | |
| 770 | 774 | :return: InlineQuery Object | |
| 771 | 775 | """ | |
| 772 | 776 | self.id = id | |
| 773 | 777 | self.from_user = from_user | |
| 778 | + self.location = location | ||
| 774 | 779 | self.query = query | |
| 775 | 780 | self.offset = offset | |
| 776 | 781 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments