File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,4 +156,30 @@ public function getUser(): ?object
156156
157157 return $ this ->customs ['user ' ];
158158 }
159+
160+ /**
161+ * Returns the trigger of the update.
162+ * A textual message in the chat.
163+ * i.e. A command, a caption, a callback data, ...
164+ *
165+ * @return string|null A string rappresenting the trigger.
166+ */
167+ public function getTrigger (): ?string
168+ {
169+ if (!isset ($ this ->customs ['trigger ' ])) {
170+ $ message = $ this ->data ->message ??
171+ $ this ->data ->edited_message ??
172+ $ this ->data ->channel_post ??
173+ $ this ->data ->edited_channel_post ??
174+ null ;
175+
176+ $ this ->customs ['trigger ' ] = $ message ->text ??
177+ $ message ->caption ??
178+ $ this ->data ->inline_query ->query ??
179+ $ this ->data ->callback_query ->data ??
180+ null ;
181+ }
182+
183+ return $ this ->customs ['trigger ' ];
184+ }
159185}
You can’t perform that action at this time.
0 commit comments