class GroupMessage : ContactMessage, Event
<init> |
GroupMessage(senderName: String, permission: MemberPermission, sender: Member, message: MessageChain) GroupMessage(senderName: String, permission: MemberPermission, sender: Member, message: MessageChain, time: Int) |
bot |
val bot: Bot |
group |
val group: Group |
message |
消息内容 val message: MessageChain |
permission |
发送方权限. val permission: MemberPermission |
sender |
发送人. val sender: Member |
senderName |
val senderName: String |
source |
消息源 val source: FromGroup |
subject |
消息事件主体. val subject: Group |
time |
消息发送时间 (由服务器提供) val time: Int |
asMember |
fun At.asMember(): Member |
toString |
fun toString(): String |
broadcast |
广播一个事件的唯一途径. suspend fun <E : Event> E.broadcast(): E |
buildForwardMessage |
使用 DSL 构建一个 ForwardMessage. fun ContactMessage.buildForwardMessage(context: Contact = this.subject, displayStrategy: DisplayStrategy = DisplayStrategy, block: ForwardMessageBuilder.() -> Unit): ForwardMessage |
isContextIdenticalWith |
判断两个 MessagePacket 的 MessagePacket.sender 和 MessagePacket.subject 是否相同 fun ContactMessage.isContextIdenticalWith(another: ContactMessage): Boolean fun MessagePacket<*, *>. |
nextMessage |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同且通过 筛选 的 MessagePacket suspend fun <P : ContactMessage> P.nextMessage(timeoutMillis: Long = -1, filter: suspend P.(P) -> Boolean): MessageChain
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <P : ContactMessage> P.nextMessage(timeoutMillis: Long = -1): MessageChain |
nextMessageAsync |
fun <P : ContactMessage> P.nextMessageAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<MessageChain> fun <P : ContactMessage> P.nextMessageAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext, filter: suspend P.(P) -> Boolean): Deferred<MessageChain> |
nextMessageContaining |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <M : Message> ContactMessage.nextMessageContaining(timeoutMillis: Long = -1): M |
nextMessageContainingAsync |
fun <M : Message> ContactMessage.nextMessageContainingAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<M> |
nextMessageContainingOrNull |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同并含有 M 类型的消息的 MessagePacket suspend fun <M : Message> ContactMessage.nextMessageContainingOrNull(timeoutMillis: Long = -1): M? |
nextMessageContainingOrNullAsync |
fun <M : Message> ContactMessage.nextMessageContainingOrNullAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<M?> |
nextMessageOrNull |
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同且通过 筛选 的 MessagePacket suspend fun <P : ContactMessage> P.nextMessageOrNull(timeoutMillis: Long = -1, filter: suspend P.(P) -> Boolean): MessageChain?
挂起当前协程, 等待下一条 MessagePacket.sender 和 MessagePacket.subject 与 this 相同的 MessagePacket suspend fun <P : ContactMessage> P.nextMessageOrNull(timeoutMillis: Long = -1): MessageChain? |
nextMessageOrNullAsync |
fun <P : ContactMessage> P.nextMessageOrNullAsync(timeoutMillis: Long = -1, coroutineContext: CoroutineContext = EmptyCoroutineContext): Deferred<MessageChain?> |
selectMessages |
挂起当前协程, 等待任意一个事件监听器触发后返回其返回值. suspend fun <T : ContactMessage, R> T.selectMessages(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilder<T, R>.() -> Unit): R |
selectMessagesUnit |
selectMessages 的 Unit 返回值捷径 (由于 Kotlin 无法推断 Unit 类型) suspend fun <T : ContactMessage> T.selectMessagesUnit(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilderUnit<T, Unit>.() -> Unit): Unit |
whileSelectMessages |
挂起当前协程, 等待任意一个事件监听器返回 suspend fun <T : ContactMessage> T.whileSelectMessages(timeoutMillis: Long = -1, filterContext: Boolean = true, selectBuilder: MessageSelectBuilder<T, Boolean>.() -> Unit): Unit |