tencentGuildBotsIfSupport
inline fun ApplicationBuilder<*>.tencentGuildBotsIfSupport(crossinline block: suspend TencentGuildBotManager.(BotRegistrar) -> Unit)
在 ApplicationBuilder.bots 作用域中寻找并使用 TencentGuildBotManager。
simpleApplication {
tencentGuildBots {
val bot = register("app id", "app key", "token") {
// config
}
bot.start()
}
}
Content copied to clipboard
如果当前环境中不存在 TencentGuildBotManager, 则不会执行 block.