Commit 6f14d32f authored by Jack'lul's avatar Jack'lul

Added migrate_from_chat_id and migrate_to_chat_id handlers

parent 999ee2e7
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Commands\SystemCommand;
/**
* Migrate from chat id command
*/
class MigratefromchatidCommand extends SystemCommand
{
/**#@+
* {@inheritdoc}
*/
protected $name = 'Migratefromchatid';
protected $description = 'Migrate from chat id';
protected $version = '1.0.1';
/**#@-*/
/**
* {@inheritdoc}
*/
/*public function execute()
{
//$message = $this->getMessage();
//$migrate_from_chat_id = $message->getMigrateFromChatId();
}*/
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Commands\SystemCommand;
/**
* Migrate to chat id command
*/
class MigratetochatidCommand extends SystemCommand
{
/**#@+
* {@inheritdoc}
*/
protected $name = 'Migratetochatid';
protected $description = 'Migrate to chat id';
protected $version = '1.0.1';
/**#@-*/
/**
* {@inheritdoc}
*/
/*public function execute()
{
//$message = $this->getMessage();
//$migrate_to_chat_id = $message->getMigrateToChatId();
}*/
}
......@@ -228,7 +228,13 @@ class Message extends Entity
}
$this->migrate_to_chat_id = isset($data['migrate_to_chat_id']) ? $data['migrate_to_chat_id'] : null;
if ($this->migrate_to_chat_id) {
$this->type = 'migrate_to_chat_id';
}
$this->migrate_from_chat_id = isset($data['migrate_from_chat_id']) ? $data['migrate_from_chat_id'] : null;
if ($this->migrate_from_chat_id) {
$this->type = 'migrate_from_chat_id';
}
}
......
......@@ -455,6 +455,8 @@ class Telegram
'delete_chat_photo',
'group_chat_created',
'left_chat_participant',
'migrate_from_chat_id',
'migrate_to_chat_id',
'new_chat_participant',
'new_chat_title',
'supergroup_chat_created',
......
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