What SHOULD be happening?
Actual behaviour
What IS happening?
Steps to reproduce
Explain how to reproduce the issue
Extra details
Please post any extra details that might help solve the issue (e.g. logs)
public function execute() {
$message = $this->getMessage();
$text = $message->getText();
$chat_id = $message->getChat()->getId();
$data = [];
$data['chat_id'] = $chat_id;
if (str_replace('/hello ', '', $text) == 'Hello') {
$message = 'Hi!';
} else {
$message = 'What you say ?';
}
$data['text'] = $message;
return Request::sendMessage($data);
}
Solved? con we close?
thank you for your answer. but i do not realize .
my user send '爻賱丕賲' in bot how can i get this massage and answer it '丿乇賵丿'
thank for your replay :) 馃憤
Is this what you want?
class GenericmessageCommand extends SystemCommand
{
public function execute()
{
$message = $this->getMessage();
if ($message && strpos($message->getText(true), '爻賱丕賲')) {
return Request::sendMessage(
[
'chat_id' => $message->getChat()->getId(),
'text' => '丿乇賵丿'
]
);
}
return Request::emptyResponse();
}
}
thank an Ocean 馃憤