@@ -150,9 +150,15 @@ public function execute()
150
150
if (is_null ($ message ->getLocation ())) {
151
151
$ this ->conversation ->notes ['state ' ] = 4 ;
152
152
$ this ->conversation ->update ();
153
-
154
- $ data ['text ' ] = 'Insert your home location (need location object): ' ;
155
- $ data ['reply_markup ' ] = new ReplyKeyBoardHide (['selective ' => true ]);
153
+ $ data ['reply_markup ' ] = new ReplyKeyboardMarkup ([
154
+ 'keyboard ' => [[
155
+ [ 'text ' => 'Share Location ' , 'request_location ' => true ],
156
+ ]],
157
+ 'resize_keyboard ' => true ,
158
+ 'one_time_keyboard ' => true ,
159
+ 'selective ' => true ,
160
+ ]);
161
+ $ data ['text ' ] = 'Share your location: ' ;
156
162
$ result = Request::sendMessage ($ data );
157
163
break ;
158
164
}
@@ -174,6 +180,27 @@ public function execute()
174
180
175
181
// no break
176
182
case 6 :
183
+ if (is_null ($ message ->getContact ())) {
184
+ $ this ->conversation ->notes ['state ' ] = 6 ;
185
+ $ this ->conversation ->update ();
186
+
187
+ $ data ['text ' ] = 'Share your contact information: ' ;
188
+ $ data ['reply_markup ' ] = new ReplyKeyboardMarkup ([
189
+ 'keyboard ' => [[
190
+ [ 'text ' => 'Share Contact ' , 'request_contact ' => true ],
191
+ ]],
192
+ 'resize_keyboard ' => true ,
193
+ 'one_time_keyboard ' => true ,
194
+ 'selective ' => true ,
195
+ ]);
196
+ $ result = Request::sendMessage ($ data );
197
+ break ;
198
+ }
199
+ $ this ->conversation ->notes ['phone_number ' ] = $ message ->getContact ()->getPhoneNumber ();
200
+
201
+ // no break
202
+ case 7 :
203
+ $ this ->conversation ->update ();
177
204
$ out_text = '/Survey result: ' . "\n" ;
178
205
unset($ this ->conversation ->notes ['state ' ]);
179
206
foreach ($ this ->conversation ->notes as $ k => $ v ) {
0 commit comments