BotVerifyInfo

BOT用于验证身份的信息,通过读取 *.bot 文件解析而来.

目前实际支持的解析格式可参考 StandardBotVerifyInfoDecoderFactory 下的所有实现。

构建

来构建一个 BotVerifyInfo 可以通过:

val path: Path("my-bot.bot.json")
val info = path.toBotVerifyInfo(StandardBotVerifyInfoDecoderFactory.Json)

在 Java 中,上述的 toBotVerifyInfo 方法存在于 BotVerifyInfos 类中。

final Path path = Paths.get("my-bot.bot.json");
final BotVerifyInfo info = BotVerifyInfos.toBotVerifyInfo(path, StandardBotVerifyInfoDecoderFactory.json());

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract override fun close()

StandardResource 在使用的过程中可能会产生一些需要手动进行 close 的产物, 因此在不使用 StandardResource 的时候,使用 close 对其进行关闭。

Link copied to clipboard
abstract override fun <T> decode(deserializer: DeserializationStrategy<T>): T

提供一个 DeserializationStrategy, 将当前验证信息解码为目标类型。

Link copied to clipboard
abstract fun inputStream(): InputStream

读取其输入流.

Link copied to clipboard
open override fun openStream(): InputStream

读取其输入流. 同 inputStream.

Properties

Link copied to clipboard
abstract val componentId: String

此验证信息中的组件信息。

Link copied to clipboard
abstract override val name: String

获取此资源的名称,一般代表其文件名。

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
Link copied to clipboard
fun Resource.toImage(id: ID = name.ID): ResourceImage

通过一个 Resource 构建一个 Image 实例。