Contact |
abstract class Contact : CoroutineScope, ContactJavaFriendlyAPI, ContactOrBot |
ContactJavaFriendlyAPI |
Contact 中为了让 abstract class ContactJavaFriendlyAPI |
ContactList |
只读联系人列表, 无锁链表实现 class ContactList<C : Contact> : Iterable<C> |
ContactOrBot |
拥有 id 的对象. 此为 Contact 与 Bot 的唯一公共接口. interface ContactOrBot |
Friend |
好友 对象. 注意: 一个 Friend 实例并不是独立的, 它属于一个 Bot. 它不能被直接构造. 任何时候都应从 Bot.getFriend 或事件中获取. abstract class Friend : QQ, CoroutineScope |
Group |
群. abstract class Group : Contact, CoroutineScope |
GroupSettings |
群设置 interface GroupSettings |
Member |
群成员. abstract class Member : MemberJavaFriendlyAPI |
MemberJavaFriendlyAPI |
Member 中为了让 abstract class MemberJavaFriendlyAPI : QQ |
MemberPermission |
群成员的权限. enum class MemberPermission : Comparable<MemberPermission> |
|
QQ 对象. abstract class |
User |
代表一个 用户. abstract class User : Contact, CoroutineScope |
BotIsBeingMutedException |
发送消息时 bot 正处于被禁言状态时抛出的异常. class BotIsBeingMutedException : RuntimeException |
MessageTooLargeException |
发送消息时消息过长抛出的异常. class MessageTooLargeException : RuntimeException |
PermissionDeniedException |
权限不足 class PermissionDeniedException : IllegalStateException |
botMuteRemaining |
val BotIsBeingMutedException.botMuteRemaining: Int |
idContentString |
ID 列表的字符串表示. 如: val ContactList<*>.idContentString: String |
isBotMuted |
返回机器人是否正在被禁言 val Group.isBotMuted: Boolean |
isFriend |
判断此成员是否为好友 val Member.isFriend: Boolean |
isMuted |
判断群成员是否处于禁言状态. val Member.isMuted: Boolean |
nameCardOrNick |
获取非空群名片或昵称. val Member.nameCardOrNick: String val User.nameCardOrNick: String |
asFriend |
得到此成员作为好友的对象. fun Member.asFriend(): Friend |
asFriendOrNull |
得到此成员作为好友的对象. fun Member.asFriendOrNull(): Friend? |
asSequence |
fun <E : Contact> ContactList<E>. |
checkBotPermission |
要求 Bot 在这个群里的权限为 required, 否则抛出异常 PermissionDeniedException fun Group.checkBotPermission(required: MemberPermission, lazyMessage: () -> String = {
"Permission denied: required $required, got actual $botPermission for $bot in group $id"
}): Unit |
checkBotPermissionOperator |
要求 Bot 在这个群里的权限为 管理员或群主, 否则抛出异常 PermissionDeniedException fun Group.checkBotPermissionOperator(lazyMessage: () -> String = {
"Permission denied: required ${MemberPermission.ADMINISTRATOR} or ${MemberPermission.OWNER}, got actual $botPermission for $bot in group $id"
}): Unit |
filteringGetOrNull |
fun <C : Contact> LockFreeLinkedList<C>. |
firstOrNull |
fun <C : Contact> LockFreeLinkedList<C>. |
get |
operator fun <C : Contact> LockFreeLinkedList<C>.get(id: Long): C |
getOrNull |
fun <C : Contact> LockFreeLinkedList<C>.getOrNull(id: Long): C? |
isAdministrator |
判断权限是否为管理员 fun MemberPermission.isAdministrator(): Boolean fun Member.isAdministrator(): Boolean |
isMuted |
判断改成员是否处于禁言状态. fun Member. |
isOperator |
判断权限是否为管理员或群主 fun MemberPermission.isOperator(): Boolean fun Member.isOperator(): Boolean |
isOwner |
判断权限是否为群主 fun MemberPermission.isOwner(): Boolean fun Member.isOwner(): Boolean |
mute |
suspend fun Member.mute(duration: Duration): Unit suspend fun Member.mute(durationSeconds: Long): Unit |
recall |
suspend fun Contact.recall(source: MessageChain): Unit suspend fun Contact.recall(source: MessageSource): Unit |
recallIn |
fun Contact.recallIn(message: MessageChain, millis: Long, coroutineContext: CoroutineContext = EmptyCoroutineContext): Job fun Contact.recallIn(source: MessageSource, millis: Long, coroutineContext: CoroutineContext = EmptyCoroutineContext): Job |
takeIfIsFriend |
如果此成员是好友, 则执行 block 并返回其返回值. 否则返回 fun <R> Member.takeIfIsFriend(block: (Friend) -> R): R? |
toList |
fun <E : Contact> ContactList<E>. |
toMutableList |
fun <E : Contact> ContactList<E>. |
toMutableSet |
fun <E : Contact> ContactList<E>. |
toSet |
fun <E : Contact> ContactList<E>. |