Skip to content

Commit

Permalink
fix issue adding event listener with object
Browse files Browse the repository at this point in the history
  • Loading branch information
peaksol-deprecated committed Nov 30, 2024
1 parent 390dc57 commit dcee7d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OneBot/Driver/Event/EventProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function addEventListener($event, callable $callback, int $level = 20)
* NOTE: 如果使用自定义名称,则需要在事件处理器中使用 `$event->getName()` 获取事件名
* NOTE: 或者是否由其他可能的方法支持自定义名称,从而避免频繁的 new EventDispatcher
*/
if (!is_object($event)) {
if (is_object($event)) {
$event = get_class($event);
}
self::$_events[$event][] = [$level, $callback];
Expand Down

0 comments on commit dcee7d2

Please sign in to comment.