1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add InlineQuery class.

This commit is contained in:
eternnoir 2016-01-04 22:24:18 +08:00
parent 7514c617fc
commit b5680a1c1f

View File

@ -515,3 +515,30 @@ class ReplyKeyboardMarkup(JsonSerializable):
json_dict['selective'] = True
return json.dumps(json_dict)
class InlineQuery(JsonDeserializable):
@classmethod
def de_json(cls, json_type):
obj = cls.check_json(json_type)
id = obj['id']
from_user = obj['from']
query = obj['query']
offset = obj['offset']
return cls(id, from_user, query, offset)
def __init__(self, id, from_user, query, offset):
"""
This object represents an incoming inline query.
When the user sends an empty query, your bot could
return some default or trending results.
:param id: string Unique identifier for this query
:param from_user: User Sender
:param query: String Text of the query
:param offset: String Offset of the results to be returned, can be controlled by the bot
:return: InlineQuery Object
"""
self.id = id
self.from_user = from_user
self.query = query
self.offset = offset