Commit 6f7e3611 authored by Armando Lüscher's avatar Armando Lüscher

Fix commands that use conversations to use corrected methods.

parent 61d732cc
...@@ -26,7 +26,7 @@ class SendtochannelCommand extends AdminCommand ...@@ -26,7 +26,7 @@ class SendtochannelCommand extends AdminCommand
protected $name = 'sendtochannel'; protected $name = 'sendtochannel';
protected $description = 'Send message to a channel'; protected $description = 'Send message to a channel';
protected $usage = '/sendtochannel <message to send>'; protected $usage = '/sendtochannel <message to send>';
protected $version = '0.1.3'; protected $version = '0.1.4';
protected $need_mysql = true; protected $need_mysql = true;
/**#@-*/ /**#@-*/
...@@ -49,7 +49,7 @@ class SendtochannelCommand extends AdminCommand ...@@ -49,7 +49,7 @@ class SendtochannelCommand extends AdminCommand
// Conversation // Conversation
$conversation = new Conversation($user_id, $chat_id, $this->getName()); $conversation = new Conversation($user_id, $chat_id, $this->getName());
$conversation->start();
$session = $conversation->getData(); $session = $conversation->getData();
$channels = (array) $this->getConfig('your_channel'); $channels = (array) $this->getConfig('your_channel');
......
...@@ -30,7 +30,7 @@ class CancelCommand extends UserCommand ...@@ -30,7 +30,7 @@ class CancelCommand extends UserCommand
protected $name = 'cancel'; protected $name = 'cancel';
protected $description = 'Cancel the currently active conversation'; protected $description = 'Cancel the currently active conversation';
protected $usage = '/cancel'; protected $usage = '/cancel';
protected $version = '0.1.0'; protected $version = '0.1.1';
protected $need_mysql = true; protected $need_mysql = true;
/**#@-*/ /**#@-*/
...@@ -47,7 +47,7 @@ class CancelCommand extends UserCommand ...@@ -47,7 +47,7 @@ class CancelCommand extends UserCommand
$this->getMessage()->getChat()->getId() $this->getMessage()->getChat()->getId()
); );
if ($conversation_command = $conversation->getConversationCommand()) { if ($conversation_command = $conversation->getCommand()) {
$conversation->cancel(); $conversation->cancel();
$text = 'Conversation "' . $conversation_command . '" cancelled!'; $text = 'Conversation "' . $conversation_command . '" cancelled!';
} }
......
...@@ -27,7 +27,7 @@ class SurveyCommand extends UserCommand ...@@ -27,7 +27,7 @@ class SurveyCommand extends UserCommand
protected $name = 'survey'; protected $name = 'survey';
protected $description = 'Survery for bot users'; protected $description = 'Survery for bot users';
protected $usage = '/survey'; protected $usage = '/survey';
protected $version = '0.1.0'; protected $version = '0.1.1';
protected $need_mysql = true; protected $need_mysql = true;
/**#@-*/ /**#@-*/
...@@ -58,10 +58,9 @@ class SurveyCommand extends UserCommand ...@@ -58,10 +58,9 @@ class SurveyCommand extends UserCommand
//tracking //tracking
$conversation = new Conversation($user_id, $chat_id, $this->getName()); $conversation = new Conversation($user_id, $chat_id, $this->getName());
$conversation->start();
//cache data from the tracking session if any //cache data from the tracking session if any
$session = $conversation->GetData(); $session = $conversation->getData();
if (!isset($session['state'])) { if (!isset($session['state'])) {
$state = '0'; $state = '0';
} else { } else {
......
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