Bot |
机器人对象. 一个机器人实例登录一个 QQ 账号. Mirai 为多账号设计, 可同时维护多个机器人. abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI, ContactOrBot |
BotFactory |
构造 Bot 的工厂. interface BotFactory |
BotImpl |
abstract class BotImpl<N : BotNetworkHandler> : Bot, CoroutineScope |
BotJavaFriendlyAPI |
Bot 中为了让 Java 使用者调用更方便的 API 列表. abstract class BotJavaFriendlyAPI |
LowLevelBotAPIAccessor |
Bot 相关协议层低级 API. interface LowLevelBotAPIAccessor |
JavaFriendlyAPI |
表明这个 API 是为了让 Java 使用者调用更方便. 一般有一定的性能损失, 且不能在 JVM/Android 以外平台使用. 不要在 Kotlin 调用它. annotation class JavaFriendlyAPI |
LowLevelAPI |
标示这个 API 是低级的 API. annotation class LowLevelAPI |
alsoLogin |
登录, 返回 this suspend fun <B : Bot> B.alsoLogin(): B |
Bot |
fun BotFactory.Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration.() -> Unit): Bot fun BotFactory.Bot(context: Context, qq: Long, password: ByteArray, configuration: BotConfiguration.() -> Unit): Bot
加载现有协议的 BotFactory, 并使用指定的 配置 构造 Bot 实例 fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration.() -> Unit): Bot fun Bot(qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot fun Bot(qq: Long, password: String, configuration: BotConfiguration.() -> Unit): Bot fun Bot(context: Context, qq: Long, passwordMd5: ByteArray, configuration: BotConfiguration = BotConfiguration.Default): Bot fun Bot(context: Context, qq: Long, passwordMd5: ByteArray, configuration: BotConfiguration.() -> Unit): Bot fun Bot(qq: Long, passwordMd5: ByteArray, configuration: BotConfiguration = BotConfiguration.Default): Bot fun Bot(qq: Long, passwordMd5: ByteArray, configuration: BotConfiguration.() -> Unit): Bot |
closeAndJoin |
关闭这个 Bot, 停止一切相关活动. 所有引用都会被释放. suspend fun Bot.closeAndJoin(cause: Throwable? = null): Unit |
containsFriend |
fun Bot.containsFriend(id: Long): Boolean |
containsGroup |
fun Bot.containsGroup(id: Long): Boolean |
getFriendOrNull |
fun Bot.getFriendOrNull(id: Long): Friend? |
getGroupOrNull |
fun Bot.getGroupOrNull(id: Long): Group? |
join |
挂起协程直到 Bot 下线. suspend fun Bot.join(): Unit |
recall |
撤回这条消息. suspend fun Bot.recall(message: MessageChain): Unit |
recallIn |
在一段时间后撤回这个消息源所指代的消息. fun Bot.recallIn(source: MessageSource, millis: Long, coroutineContext: CoroutineContext = EmptyCoroutineContext): Job
在一段时间后撤回这条消息. fun Bot.recallIn(message: MessageChain, millis: Long, coroutineContext: CoroutineContext = EmptyCoroutineContext): Job |