mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 09:10:11 +08:00
Add group
and senderName
shortcuts to TempMessage
This commit is contained in:
parent
2b95bea8da
commit
f7f3e88878
@ -1,7 +1,9 @@
|
||||
package net.mamoe.mirai.message
|
||||
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.contact.Group
|
||||
import net.mamoe.mirai.contact.Member
|
||||
import net.mamoe.mirai.contact.nameCardOrNick
|
||||
import net.mamoe.mirai.event.BroadcastControllable
|
||||
import net.mamoe.mirai.message.data.MessageChain
|
||||
import net.mamoe.mirai.message.data.MessageSource
|
||||
@ -27,6 +29,8 @@ class TempMessage(
|
||||
override val sender: Member by sender.unsafeWeakRef()
|
||||
override val bot: Bot get() = sender.bot
|
||||
override val subject: Member get() = sender
|
||||
inline val group: Group get() = sender.group
|
||||
inline val senderName: String get() = sender.nameCardOrNick
|
||||
override val source: OnlineMessageSource.Incoming.FromTemp get() = message.source as OnlineMessageSource.Incoming.FromTemp
|
||||
|
||||
override fun toString(): String =
|
||||
|
Loading…
Reference in New Issue
Block a user