@@ -44,8 +44,8 @@ public function __construct(array $config, Stdio $client)
4444 $ this ->config = Collection::make ($ config );
4545 $ this ->client = $ client ;
4646
47- $ this ->client ->on ('line ' , function ($ line ) {
48- $ this ->message = $ line ;
47+ $ this ->client ->on ('data ' , function ($ line ) {
48+ $ this ->message = rtrim ( $ line, "\r\n" ) ;
4949 });
5050 }
5151
@@ -114,7 +114,7 @@ public function isBot()
114114 */
115115 public function types (IncomingMessage $ matchingMessage )
116116 {
117- $ this ->client ->writeln (self ::BOT_NAME .': ... ' );
117+ $ this ->client ->write (self ::BOT_NAME .': ... ' . PHP_EOL );
118118 }
119119
120120 /**
@@ -163,11 +163,11 @@ public function buildServicePayload($message, $matchingMessage, $additionalParam
163163 public function sendPayload ($ payload )
164164 {
165165 $ questionData = $ payload ['questionData ' ];
166- $ this ->client ->writeln (self ::BOT_NAME .': ' .$ payload ['text ' ]);
166+ $ this ->client ->write (self ::BOT_NAME .': ' .$ payload ['text ' ]. PHP_EOL );
167167
168168 if (! is_null ($ questionData )) {
169169 foreach ($ questionData ['actions ' ] as $ key => $ action ) {
170- $ this ->client ->writeln (($ key + 1 ).') ' .$ action ['text ' ]);
170+ $ this ->client ->write (($ key + 1 ).') ' .$ action ['text ' ]. PHP_EOL );
171171 }
172172 $ this ->hasQuestion = true ;
173173 $ this ->lastQuestions = $ questionData ['actions ' ];
0 commit comments