src/Commands/AdminCommands/SendtochannelCommand.php 1 location
|
@@ 94-103 (lines=10) @@
|
91 |
|
switch ($state) { |
92 |
|
case -1: |
93 |
|
// getConfig has not been configured asking for channel to administer |
94 |
|
if ($type !== 'Message' || $text === '') { |
95 |
|
$notes['state'] = -1; |
96 |
|
$this->conversation->update(); |
97 |
|
|
98 |
|
$data['text'] = 'Insert the channel name: (@yourchannel)'; |
99 |
|
$data['reply_markup'] = new ReplyKeyBoardHide(['selective' => true]); |
100 |
|
$result = Request::sendMessage($data); |
101 |
|
|
102 |
|
break; |
103 |
|
} |
104 |
|
$notes['channel'] = $text; |
105 |
|
$notes['last_message_id'] = $message->getMessageId(); |
106 |
|
// Jump to state 1 |
src/Commands/UserCommands/SurveyCommand.php 1 location
|
@@ 103-112 (lines=10) @@
|
100 |
|
//Every time a step is achieved the track is updated |
101 |
|
switch ($state) { |
102 |
|
case 0: |
103 |
|
if ($text === '') { |
104 |
|
$notes['state'] = 0; |
105 |
|
$this->conversation->update(); |
106 |
|
|
107 |
|
$data['text'] = 'Type your name:'; |
108 |
|
$data['reply_markup'] = new ReplyKeyBoardHide(['selective' => true]); |
109 |
|
|
110 |
|
$result = Request::sendMessage($data); |
111 |
|
break; |
112 |
|
} |
113 |
|
|
114 |
|
$notes['name'] = $text; |
115 |
|
$text = ''; |