Избавление от phpdotenv, переработка сборщика

This commit is contained in:
RedHood
2020-09-17 22:27:12 +10:00
parent 7c0fcc392d
commit 48946d9070
14 changed files with 253 additions and 253 deletions

View File

@@ -4,8 +4,9 @@ declare(strict_types=1);
namespace VK\API\Methods;
use VK\Core;
use VK\API\Traits\Request;
use \VK\Core;
use \VK\API\Traits\Request;
use \VK\Robots\RobotAbstract;
class Message
{
@@ -13,10 +14,16 @@ class Message
private const METHOD = 'messages.send';
public static function post($from, $to, $message, $trolling)
public static function post($from, int $to, string $message, int $trolling)
{
if (is_int($from)) $from = Core::init()->get($from);
if (is_int($from)) {
// Если получен идентификатор, а не экземпляр RobotAbstract
// Поиск в регистре
$from = Core::init()->get($from);
}
// Параметры
$params = [
'message' => $message,
'peer_id' => $to,
@@ -25,6 +32,7 @@ class Message
'random_id' => $trolling
];
// Запрос
self::request(self::METHOD, $params, $from->getBrowser());
}