mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-06 08:00:10 +08:00
this
is now instance of GroupMessage
for sentFrom
This commit is contained in:
parent
5d46d1c4be
commit
ab4a0c82d6
@ -398,8 +398,10 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
|
||||
* 如果是来自这个群的消息, 就执行 [onEvent]
|
||||
*/
|
||||
@MessageDsl
|
||||
inline fun sentFrom(groupId: Long, crossinline onEvent: MessageListener<T>): Listener<T> =
|
||||
content({ this is GroupMessage && this.group.id == groupId }, onEvent)
|
||||
inline fun sentFrom(groupId: Long, crossinline onEvent: MessageListener<GroupMessage>): Listener<T> =
|
||||
content({ this is GroupMessage && this.group.id == groupId }){
|
||||
onEvent(this as GroupMessage, it)
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果消息内容包含 [M] 类型的 [Message]
|
||||
|
Loading…
Reference in New Issue
Block a user