From 4867f150a3d65e3746d27741fca4e21996179774 Mon Sep 17 00:00:00 2001 From: Peaksol Date: Sat, 30 Nov 2024 20:35:02 +0800 Subject: [PATCH] add `self` field to EventBuilder --- src/OneBot/V12/EventBuilder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OneBot/V12/EventBuilder.php b/src/OneBot/V12/EventBuilder.php index 8ace3e9..2a44d84 100644 --- a/src/OneBot/V12/EventBuilder.php +++ b/src/OneBot/V12/EventBuilder.php @@ -23,6 +23,10 @@ public function __construct(string $type, string $detail_type = '', string $sub_ $this->data['time'] = $time ?? time(); $this->data['detail_type'] = $detail_type; $this->data['sub_type'] = $sub_type; + $this->data['self'] = [ + 'platform' => OneBot::getInstance()->getPlatform(), + 'user_id' => OneBot::getInstance()->getSelfId(), + ]; } public function feed(string $key, $value): EventBuilder