feat: System MessageTarget를 빠르게 생성하는 함수
This commit is contained in:
@@ -381,7 +381,7 @@ class Message
|
|||||||
* @param string $msg
|
* @param string $msg
|
||||||
*/
|
*/
|
||||||
public static function sendPrivateMsgAsNotice(array|int|MessageTarget $targets, string $msg): void{
|
public static function sendPrivateMsgAsNotice(array|int|MessageTarget $targets, string $msg): void{
|
||||||
$src = new MessageTarget(0, '', 0, 'System', '#000000');
|
$src = MessageTarget::buildSystemTarget();
|
||||||
if(is_int($targets)){
|
if(is_int($targets)){
|
||||||
$targets = [$targets];
|
$targets = [$targets];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ class MessageTarget extends Target {
|
|||||||
return new MessageTarget($generalID, $generalName, $nationID, $nation['name'], $nation['color'], $icon);
|
return new MessageTarget($generalID, $generalName, $nationID, $nation['name'], $nation['color'], $icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function buildSystemTarget(): MessageTarget{
|
||||||
|
return new MessageTarget(0, '', 0, 'System', '#000000');
|
||||||
|
}
|
||||||
|
|
||||||
public function toArray() : array{
|
public function toArray() : array{
|
||||||
return [
|
return [
|
||||||
'id'=>$this->generalID,
|
'id'=>$this->generalID,
|
||||||
|
|||||||
Reference in New Issue
Block a user