From 853a42b856486becb6e9dd8a64b12d9b5e5430d1 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 19 Feb 2023 23:02:50 +0800 Subject: [PATCH] fix adaptive sleep float convert bug --- src/OneBot/Driver/Coroutine/Adaptive.php | 2 +- src/OneBot/V12/Object/MessageSegment.php | 2 -- src/OneBot/global_defines.php | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/OneBot/Driver/Coroutine/Adaptive.php b/src/OneBot/Driver/Coroutine/Adaptive.php index dd108ed..f7109b0 100644 --- a/src/OneBot/Driver/Coroutine/Adaptive.php +++ b/src/OneBot/Driver/Coroutine/Adaptive.php @@ -50,7 +50,7 @@ public static function sleep($time) return; } if (self::$coroutine instanceof FiberCoroutine) { - WorkermanDriver::getInstance()->getEventLoop()->addTimer($time * 1000, function () use ($cid) { + WorkermanDriver::getInstance()->getEventLoop()->addTimer(intval($time * 1000), function () use ($cid) { self::$coroutine->resume($cid); }); self::$coroutine->suspend(); diff --git a/src/OneBot/V12/Object/MessageSegment.php b/src/OneBot/V12/Object/MessageSegment.php index e636864..5917824 100644 --- a/src/OneBot/V12/Object/MessageSegment.php +++ b/src/OneBot/V12/Object/MessageSegment.php @@ -4,8 +4,6 @@ namespace OneBot\V12\Object; -use ReturnTypeWillChange; - class MessageSegment implements \JsonSerializable, \IteratorAggregate { /** @var string 类型 */ diff --git a/src/OneBot/global_defines.php b/src/OneBot/global_defines.php index 8dcab8d..19cec1b 100644 --- a/src/OneBot/global_defines.php +++ b/src/OneBot/global_defines.php @@ -13,7 +13,7 @@ use ZM\Logger\ConsoleLogger; const ONEBOT_VERSION = '12'; -const ONEBOT_LIBOB_VERSION = '0.5.10'; +const ONEBOT_LIBOB_VERSION = '0.5.11'; const ONEBOT_JSON = 1; const ONEBOT_MSGPACK = 2;