Админка: телеграф переехал в Chat.
This commit is contained in:
@@ -62,14 +62,18 @@ class Chat
|
||||
return $wrappedMessage;
|
||||
}
|
||||
|
||||
public function addMessage(string $msg)
|
||||
public function sendMessage(string $msg)
|
||||
{
|
||||
$this->db->execute('insert into chat (user_id, msg) values (?,?)', [User::getInstance()->getId(), $msg]);
|
||||
}
|
||||
|
||||
public static function addSYSMessage( string $msg, ?int $receiver_id = null)
|
||||
public static function sendSys(string $msg, ?int $receiver_id = null)
|
||||
{
|
||||
Db::getInstance()->execute('insert into chat (user_id, msg, receiver_id, type) values (?,?,?,?)', [User::getInstance()->getId(), $msg, $receiver_id, 'sys']);
|
||||
Db::getInstance()->execute('insert into chat (user_id, msg, receiver_id, type) values (-1,?,?,?)', [$msg, $receiver_id, 'sys']);
|
||||
}
|
||||
public static function sendTelegraf(string $msg, int $receiver_id)
|
||||
{
|
||||
Db::getInstance()->execute('insert into chat (user_id, msg, receiver_id, type) values (-1,?,?,?)', [$msg, $receiver_id, 'sms']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -213,7 +213,7 @@ class UserStats extends User
|
||||
$this->level += 1;
|
||||
$this->free_stat_points += 2;
|
||||
$this->saveStats();
|
||||
Chat::addSYSMessage('Внимание, вы получили ' . $this->level . 'уровень. Доступны очки распределения параметров.');
|
||||
Chat::sendSys('Внимание, вы получили ' . $this->level . 'уровень. Доступны очки распределения параметров.');
|
||||
return 'Персонаж перешёл на ' . $this->level . 'уровень.';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user