From 8b463081582ebb82f1f0555e0790ce90ba931b4d Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Mon, 5 Aug 2024 20:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95TODO=E4=BB=A3=E5=8A=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see also: https://github.com/simple-robot/simpler-robot/issues/884 --- .../telegram/core/bot/internal/TelegramBotManagerImpl.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt b/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt index 1f6ad6f..43e595c 100644 --- a/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt +++ b/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt @@ -59,6 +59,11 @@ internal class TelegramBotManagerImpl( override fun register(ticket: Bot.Ticket, configuration: TelegramBotConfiguration): TelegramBot { val token = ticket.token + @Suppress("ControlFlowWithEmptyBody") + if (token.startsWith("bot")) { + // TODO 不需要手动写 `bot`, 如果写了,移除它,并有一个警告 + } + fun createBot(): TelegramBotImpl { val context = configuration.coroutineContext.mergeWith(coroutineContext) val job = context[Job]!!