mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
fix bot context not sync
This commit is contained in:
@@ -26,8 +26,16 @@ class ContainerRegistrant
|
||||
self::addServices([
|
||||
OneBotEvent::class => $event,
|
||||
'bot.event' => DI\get(OneBotEvent::class),
|
||||
BotContext::class => fn () => bot(),
|
||||
]);
|
||||
|
||||
if (isset($event->self['platform'])) {
|
||||
self::addServices([
|
||||
BotContext::class => DI\autowire(BotContext::class)->constructor(
|
||||
$event->self['user_id'] ?? '',
|
||||
$event->self['platform'],
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user