mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 15:10:14 +08:00
Throw UnsupportedOperationException for OtherClient.sendMessage and OtherClient.uploadImage
This commit is contained in:
parent
7015501f53
commit
15ee2303c2
@ -12,8 +12,12 @@
|
||||
package net.mamoe.mirai.contact
|
||||
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.message.MessageReceipt
|
||||
import net.mamoe.mirai.message.data.Image
|
||||
import net.mamoe.mirai.message.data.Message
|
||||
import net.mamoe.mirai.utils.BotConfiguration.MiraiProtocol.ANDROID_PAD
|
||||
import net.mamoe.mirai.utils.BotConfiguration.MiraiProtocol.ANDROID_PHONE
|
||||
import net.mamoe.mirai.utils.ExternalImage
|
||||
|
||||
/**
|
||||
* 其他设备. 如当 [Bot] 以 [ANDROID_PHONE] 登录时, 还可以有其他设备以 [ANDROID_PAD], iOS, PC 或其他设备登录.
|
||||
@ -33,6 +37,14 @@ public interface OtherClient : Contact {
|
||||
* 与 [Bot.id] 相同
|
||||
*/
|
||||
public override val id: Long get() = bot.id
|
||||
|
||||
override suspend fun sendMessage(message: Message): MessageReceipt<OtherClient> {
|
||||
throw UnsupportedOperationException("OtherClientImpl.sendMessage is not yet supported.")
|
||||
}
|
||||
|
||||
override suspend fun uploadImage(image: ExternalImage): Image {
|
||||
throw UnsupportedOperationException("OtherClientImpl.uploadImage is not yet supported.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,6 @@ package net.mamoe.mirai.internal.contact
|
||||
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.contact.ClientKind
|
||||
import net.mamoe.mirai.contact.Contact
|
||||
import net.mamoe.mirai.contact.OtherClient
|
||||
import net.mamoe.mirai.message.MessageReceipt
|
||||
import net.mamoe.mirai.message.data.Image
|
||||
@ -29,12 +28,12 @@ internal class OtherClientImpl(
|
||||
override val kind: ClientKind,
|
||||
val instanceInfo: InstanceInfo
|
||||
) : OtherClient, AbstractContact(bot, coroutineContext) {
|
||||
override suspend fun sendMessage(message: Message): MessageReceipt<Contact> {
|
||||
TODO("Not yet implemented")
|
||||
override suspend fun sendMessage(message: Message): MessageReceipt<OtherClient> {
|
||||
throw UnsupportedOperationException("OtherClientImpl.sendMessage is not yet supported.")
|
||||
}
|
||||
|
||||
override suspend fun uploadImage(image: ExternalImage): Image {
|
||||
TODO("Not yet implemented")
|
||||
throw UnsupportedOperationException("OtherClientImpl.uploadImage is not yet supported.")
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
|
Loading…
Reference in New Issue
Block a user