1 | <?php |
||
22 | class AnswerInlineQuery extends TelegramMethods |
||
23 | { |
||
24 | /** |
||
25 | * Unique identifier for the answered query |
||
26 | * @var string |
||
27 | */ |
||
28 | public $inline_query_id = ''; |
||
29 | |||
30 | /** |
||
31 | * A JSON-serialized array (of InlineQueryResult) of results for the inline query |
||
32 | * @var array[] |
||
33 | */ |
||
34 | protected $results = []; |
||
35 | |||
36 | /** |
||
37 | * Optional. The maximum amount of time in seconds that the result of the inline query may be cached on the server. |
||
38 | * Defaults to 300. |
||
39 | * @var int |
||
40 | */ |
||
41 | public $cache_time = 300; |
||
42 | |||
43 | /** |
||
44 | * Optional. Pass True, if results may be cached on the server side only for the user that sent the query. By |
||
45 | * default, results may be returned to any user who sends the same query |
||
46 | * @var bool |
||
47 | */ |
||
48 | public $is_personal = false; |
||
49 | |||
50 | /** |
||
51 | * Optional. Pass the offset that a client should send in the next query with the same text to receive more results. |
||
52 | * Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t |
||
53 | * exceed 64 bytes. |
||
54 | * @var string |
||
55 | */ |
||
56 | public $next_offset = ''; |
||
57 | |||
58 | /** |
||
59 | * Optional. If passed, clients will display a button with specified text that switches the user to a private chat |
||
60 | * with the bot and sends the bot a start message with the parameter switch_pm_parameter |
||
61 | * @var string |
||
62 | */ |
||
63 | public $switch_pm_text = ''; |
||
64 | |||
65 | /** |
||
66 | * Optional. Parameter for the start message sent to the bot when user presses the switch button |
||
67 | * |
||
68 | * Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to |
||
69 | * adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the |
||
70 | * results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in |
||
71 | * doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a |
||
72 | * switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline |
||
73 | * capabilities. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | public $switch_pm_parameter = ''; |
||
78 | |||
79 | public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes |
||
83 | |||
84 | public function performSpecialConditions(): TelegramMethods |
||
90 | |||
91 | public function getMandatoryFields(): array |
||
98 | |||
99 | /** |
||
100 | * Use this method to add a result, this will delete all additional unneeded information from the subclass |
||
101 | * |
||
102 | * @param Result $result |
||
103 | * @return AnswerInlineQuery |
||
104 | * @throws \unreal4u\TelegramAPI\Exceptions\MissingMandatoryField |
||
105 | */ |
||
106 | public function addResult(Result $result): AnswerInlineQuery |
||
111 | |||
112 | /** |
||
113 | * Use this method to get list of added results |
||
114 | * |
||
115 | * @return AnswerInlineQuery[] |
||
116 | */ |
||
117 | public function getResults(): array |
||
121 | } |
||
122 |