Commit 7db0a913 authored by Armando Lüscher's avatar Armando Lüscher

Fix how the /sendtochannel command is ended.

When the command ends, the last step should be to actually "stop" it, not before, as some data already goes lost when stopping the conversation.
parent 92608fd3
...@@ -215,18 +215,20 @@ class SendtochannelCommand extends AdminCommand ...@@ -215,18 +215,20 @@ class SendtochannelCommand extends AdminCommand
$this->conversation->notes['last_message_id'] = $message->getMessageId(); $this->conversation->notes['last_message_id'] = $message->getMessageId();
// no break // no break
case 5: case 5:
$this->conversation->stop();
$data['reply_markup'] = new ReplyKeyBoardHide(['selective' => true]); $data['reply_markup'] = new ReplyKeyBoardHide(['selective' => true]);
if ($this->conversation->notes['post_message']) { if ($this->conversation->notes['post_message']) {
$data['text'] = $this->publish(new Message($this->conversation->notes['message'], 'anystring'), $this->conversation->notes['channel'], $this->conversation->notes['caption']); $data['text'] = $this->publish(
$result = Request::sendMessage($data); new Message($this->conversation->notes['message'], 'anystring'),
break; $this->conversation->notes['channel'],
$this->conversation->notes['caption']
);
} else {
$data['text'] = 'Abort by user, message not sent..';
} }
$data['text'] = 'Abort by user, message not sent..'; $this->conversation->stop();
$result = Request::sendMessage($data); $result = Request::sendMessage($data);
break;
} }
return $result; return $result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment