qqGuildBots
inline fun ApplicationBuilder<*>.qqGuildBots(crossinline block: suspend QQGuildBotManager.(BotRegistrar) -> Unit)(source)
在 ApplicationBuilder.bots 作用域中寻找并使用 QQGuildBotManager。
simpleApplication {
qqGuildBots {
val bot = register("app id", "app key", "token") {
// config
}
bot.start()
}
}
Content copied to clipboard
如果当前环境中不存在 QQGuildBotManager, 则会抛出 NoSuchElementException. 此异常不会在准备阶段被抛出,而是在真正执行构建时。