mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 17:00:14 +08:00
Fix returnType and add JvmBlockingBridge for ConsoleCommandSender.sendMessage
This commit is contained in:
parent
7762ea2f65
commit
8b5c6dfa27
@ -501,7 +501,6 @@ public fun CommandSender.getBotOrNull(): Bot? {
|
|||||||
*
|
*
|
||||||
* 控制台拥有一切指令的执行权限.
|
* 控制台拥有一切指令的执行权限.
|
||||||
*/
|
*/
|
||||||
// 前端实现
|
|
||||||
public object ConsoleCommandSender : AbstractCommandSender() {
|
public object ConsoleCommandSender : AbstractCommandSender() {
|
||||||
public const val NAME: String = "ConsoleCommandSender"
|
public const val NAME: String = "ConsoleCommandSender"
|
||||||
|
|
||||||
@ -514,12 +513,15 @@ public object ConsoleCommandSender : AbstractCommandSender() {
|
|||||||
public override val permitteeId: AbstractPermitteeId.Console = AbstractPermitteeId.Console
|
public override val permitteeId: AbstractPermitteeId.Console = AbstractPermitteeId.Console
|
||||||
|
|
||||||
public override val coroutineContext: CoroutineContext by lazy { MiraiConsole.childScopeContext(NAME) }
|
public override val coroutineContext: CoroutineContext by lazy { MiraiConsole.childScopeContext(NAME) }
|
||||||
|
|
||||||
|
@JvmBlockingBridge
|
||||||
public override suspend fun sendMessage(message: Message): Nothing? {
|
public override suspend fun sendMessage(message: Message): Nothing? {
|
||||||
MiraiConsoleImplementationBridge.consoleCommandSender.sendMessage(message)
|
MiraiConsoleImplementationBridge.consoleCommandSender.sendMessage(message)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
public override suspend fun sendMessage(message: String): MessageReceipt<User>? {
|
@JvmBlockingBridge
|
||||||
|
public override suspend fun sendMessage(message: String): Nothing? {
|
||||||
MiraiConsoleImplementationBridge.consoleCommandSender.sendMessage(message)
|
MiraiConsoleImplementationBridge.consoleCommandSender.sendMessage(message)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user