mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Fix subject of MemberCommandSender
This commit is contained in:
parent
d04d6fa1b3
commit
0b72ee424c
@ -164,7 +164,7 @@ public interface CommandSender : CoroutineScope {
|
|||||||
* 对于 [MemberCommandSender], 这个函数总是发送给所在群
|
* 对于 [MemberCommandSender], 这个函数总是发送给所在群
|
||||||
*/
|
*/
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public suspend fun sendMessage(message: Message): MessageReceipt<User>?
|
public suspend fun sendMessage(message: Message): MessageReceipt<Contact>?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立刻发送一条消息.
|
* 立刻发送一条消息.
|
||||||
@ -173,7 +173,7 @@ public interface CommandSender : CoroutineScope {
|
|||||||
*/
|
*/
|
||||||
@JvmDefault
|
@JvmDefault
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public suspend fun sendMessage(message: String): MessageReceipt<User>?
|
public suspend fun sendMessage(message: String): MessageReceipt<Contact>?
|
||||||
|
|
||||||
@ConsoleExperimentalAPI("This is unstable and might get changed")
|
@ConsoleExperimentalAPI("This is unstable and might get changed")
|
||||||
public suspend fun catchExecutionException(e: Throwable)
|
public suspend fun catchExecutionException(e: Throwable)
|
||||||
@ -588,10 +588,10 @@ public sealed class AbstractUserCommandSender : UserCommandSender, AbstractComma
|
|||||||
public final override val name: String get() = user.nameCardOrNick
|
public final override val name: String get() = user.nameCardOrNick
|
||||||
|
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public override suspend fun sendMessage(message: String): MessageReceipt<User> = sendMessage(PlainText(message))
|
public override suspend fun sendMessage(message: String): MessageReceipt<Contact> = sendMessage(PlainText(message))
|
||||||
|
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public override suspend fun sendMessage(message: Message): MessageReceipt<User> = user.sendMessage(message)
|
public override suspend fun sendMessage(message: Message): MessageReceipt<Contact> = user.sendMessage(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -621,14 +621,14 @@ public open class MemberCommandSender internal constructor(
|
|||||||
GroupAwareCommandSender,
|
GroupAwareCommandSender,
|
||||||
CoroutineScope by user.childScope("MemberCommandSender") {
|
CoroutineScope by user.childScope("MemberCommandSender") {
|
||||||
public override val group: Group get() = user.group
|
public override val group: Group get() = user.group
|
||||||
public override val subject: Contact get() = group
|
public override val subject: Group get() = group
|
||||||
public override fun toString(): String = "MemberCommandSender($user)"
|
public override fun toString(): String = "MemberCommandSender($user)"
|
||||||
|
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public override suspend fun sendMessage(message: String): MessageReceipt<Member> = sendMessage(PlainText(message))
|
public override suspend fun sendMessage(message: String): MessageReceipt<Group> = sendMessage(PlainText(message))
|
||||||
|
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
public override suspend fun sendMessage(message: Message): MessageReceipt<Member> = user.sendMessage(message)
|
public override suspend fun sendMessage(message: Message): MessageReceipt<Group> = subject.sendMessage(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user