diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt index cb559aebd..5565cda58 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt @@ -76,10 +76,10 @@ data class PlainText(override val stringValue: String) : Message() { * 图片消息. * 由接收消息时构建, 可直接发送 * - * @param imageId 类似 `{7AA4B3AA-8C3C-0F45-2D9B-7F302A0ACEAA}.jpg`. 群的是大写id, 好友的是小写id + * @param id 类似 `{7AA4B3AA-8C3C-0F45-2D9B-7F302A0ACEAA}.jpg`. 群的是大写id, 好友的是小写id */ -data class Image(val imageId: String) : Message() { - override val stringValue: String = "[$imageId]" +data class Image(val id: String) : Message() { + override val stringValue: String = "[$id]" } // ==================================== At ==================================== @@ -168,7 +168,7 @@ data class MessageChain( override fun retainAll(elements: Collection): Boolean = delegate.retainAll(elements) override fun set(index: Int, element: Message): Message = delegate.set(index, element) override fun subList(fromIndex: Int, toIndex: Int): MutableList = delegate.subList(fromIndex, toIndex) - override fun iterator(): MutableIterator = this.delegate.iterator() + override fun iterator(): MutableIterator = delegate.iterator() override operator fun contains(element: Message): Boolean = delegate.contains(element) override val size: Int = delegate.size // endregion diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/internal/MessageDataInternal.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/internal/MessageDataInternal.kt index a4225ec14..a07661d73 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/internal/MessageDataInternal.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/internal/MessageDataInternal.kt @@ -143,7 +143,7 @@ fun MessageChain.toPacket(): ByteReadPacket = buildPacket { writeLVPacket { writeByte(0x02) - writeLVString(imageId) + writeLVString(id) writeHex("04 00 " + "04 9B 53 B0 08 " + "05 00 " + @@ -153,7 +153,7 @@ fun MessageChain.toPacket(): ByteReadPacket = buildPacket { "07 00 " + "01 43 08 00 00 09 00 01 01 0B 00 00 14 00 04 11 00 00 00 15 00 04 00 00 02 BC 16 00 04 00 00 02 BC 18 00 04 00 00 7D 5E FF 00 5C 15 36 20 39 32 6B 41 31 43 39 62 35 33 62 30 30 38 64 39 38 61 35 61 37 30 20") writeHex("20 20 20 20 20 35 30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20") - writeStringUtf8(imageId) + writeStringUtf8(id) writeByte(0x41) } }