Remove all unnecessary java-friendly JvmName magics

This commit is contained in:
Him188 2020-03-23 20:05:17 +08:00
parent ac263579f6
commit fccb69bb3f
18 changed files with 1 additions and 80 deletions

View File

@ -59,7 +59,6 @@ internal class QQImpl(
override val nick: String override val nick: String
get() = friendInfo.nick get() = friendInfo.nick
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Suppress("DuplicatedCode") @Suppress("DuplicatedCode")
override suspend fun sendMessage(message: Message): MessageReceipt<out QQ> { override suspend fun sendMessage(message: Message): MessageReceipt<out QQ> {
@ -82,14 +81,12 @@ internal class QQImpl(
return MessageReceipt(source, this, null) return MessageReceipt(source, this, null)
} }
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> { override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> {
return this.sendMessage(message as Message) return this.sendMessage(message as Message)
} }
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
@OptIn(MiraiInternalAPI::class) @OptIn(MiraiInternalAPI::class)
override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage = try { override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage = try {
@ -222,7 +219,6 @@ internal class MemberImpl(
@MiraiExperimentalAPI @MiraiExperimentalAPI
override suspend fun queryRemark(): FriendNameRemark = qq.queryRemark() override suspend fun queryRemark(): FriendNameRemark = qq.queryRemark()
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Suppress("DuplicatedCode") @Suppress("DuplicatedCode")
override suspend fun sendMessage(message: Message): MessageReceipt<Member> { override suspend fun sendMessage(message: Message): MessageReceipt<Member> {
@ -245,14 +241,12 @@ internal class MemberImpl(
return MessageReceipt(source, this, null) return MessageReceipt(source, this, null)
} }
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> { override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> {
return this.sendMessage(message as Message) return this.sendMessage(message as Message)
} }
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage = qq.uploadImage(image) override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage = qq.uploadImage(image)
// endregion // endregion
@ -317,7 +311,6 @@ internal class MemberImpl(
override val bot: QQAndroidBot get() = qq.bot override val bot: QQAndroidBot get() = qq.bot
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun mute(durationSeconds: Int) { override suspend fun mute(durationSeconds: Int) {
if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) { if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) {
@ -337,7 +330,6 @@ internal class MemberImpl(
net.mamoe.mirai.event.events.MemberMuteEvent(this@MemberImpl, durationSeconds, null).broadcast() net.mamoe.mirai.event.events.MemberMuteEvent(this@MemberImpl, durationSeconds, null).broadcast()
} }
@JvmName("unmuteSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun unmute() { override suspend fun unmute() {
if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) { if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) {
@ -357,7 +349,6 @@ internal class MemberImpl(
net.mamoe.mirai.event.events.MemberUnmuteEvent(this@MemberImpl, null).broadcast() net.mamoe.mirai.event.events.MemberUnmuteEvent(this@MemberImpl, null).broadcast()
} }
@JvmName("kickSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun kick(message: String) { override suspend fun kick(message: String) {
if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) { if (group.botPermission != MemberPermission.OWNER && (!group.botPermission.isOperator() || this.isOperator())) {
@ -631,7 +622,6 @@ internal class GroupImpl(
return members.delegate.filteringGetOrNull { it.id == id } return members.delegate.filteringGetOrNull { it.id == id }
} }
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun sendMessage(message: Message): MessageReceipt<Group> { override suspend fun sendMessage(message: Message): MessageReceipt<Group> {
check(!isBotMuted) { "bot is muted. Remaining seconds=$botMuteRemaining" } check(!isBotMuted) { "bot is muted. Remaining seconds=$botMuteRemaining" }
@ -657,7 +647,6 @@ internal class GroupImpl(
return MessageReceipt(source, this, botAsMember) return MessageReceipt(source, this, botAsMember)
} }
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group> { override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group> {
@ -665,7 +654,6 @@ internal class GroupImpl(
} }
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage = try { override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage = try {
if (BeforeImageUploadEvent(this, image).broadcast().isCancelled) { if (BeforeImageUploadEvent(this, image).broadcast().isCancelled) {

View File

@ -148,7 +148,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
/** /**
* 挂起协程直到 [Bot] 下线. * 挂起协程直到 [Bot] 下线.
*/ */
@JvmName("joinSuspend")
@JvmSynthetic @JvmSynthetic
actual suspend inline fun join() = network.join() actual suspend inline fun join() = network.join()
@ -162,7 +161,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* *
* @throws LoginFailedException * @throws LoginFailedException
*/ */
@JvmName("loginSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun login() actual abstract suspend fun login()
// endregion // endregion
@ -184,14 +182,12 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @see _lowLevelRecallFriendMessage 低级 API * @see _lowLevelRecallFriendMessage 低级 API
* @see _lowLevelRecallGroupMessage 低级 API * @see _lowLevelRecallGroupMessage 低级 API
*/ */
@JvmName("recallSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun recall(source: MessageSource) actual abstract suspend fun recall(source: MessageSource)
/** /**
* 获取图片下载链接 * 获取图片下载链接
*/ */
@JvmName("queryImageUrlSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun queryImageUrl(image: Image): String actual abstract suspend fun queryImageUrl(image: Image): String
@ -201,7 +197,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @see ByteReadChannel.copyAndClose * @see ByteReadChannel.copyAndClose
* @see ByteReadChannel.copyTo * @see ByteReadChannel.copyTo
*/ */
@JvmName("openChannelSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun openChannel(image: Image): ByteReadChannel actual abstract suspend fun openChannel(image: Image): ByteReadChannel
@ -211,7 +206,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @param message 若需要验证请求时的验证消息. * @param message 若需要验证请求时的验证消息.
* @param remark 好友备注 * @param remark 好友备注
*/ */
@JvmName("addFriendSuspend")
@JvmSynthetic @JvmSynthetic
@MiraiExperimentalAPI("未支持") @MiraiExperimentalAPI("未支持")
actual abstract suspend fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult actual abstract suspend fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult

View File

@ -63,11 +63,9 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
* *
* @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息. * @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息.
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact> actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact> actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>
@ -81,7 +79,6 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun uploadImage(image: ExternalImage): OfflineImage actual abstract suspend fun uploadImage(image: ExternalImage): OfflineImage

View File

@ -178,11 +178,9 @@ actual abstract class Group : Contact(), CoroutineScope {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>
@ -196,7 +194,6 @@ actual abstract class Group : Contact(), CoroutineScope {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage

View File

@ -90,7 +90,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberMuteEvent 成员被禁言事件 * @see MemberMuteEvent 成员被禁言事件
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun mute(durationSeconds: Int) actual abstract suspend fun mute(durationSeconds: Int)
@ -102,7 +101,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberUnmuteEvent 成员被取消禁言事件. * @see MemberUnmuteEvent 成员被取消禁言事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("unmuteSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun unmute() actual abstract suspend fun unmute()
@ -117,11 +115,9 @@ actual abstract class Member : MemberJavaHappyAPI() {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
@ -134,7 +130,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberLeaveEvent.Kick 成员被踢出事件. * @see MemberLeaveEvent.Kick 成员被踢出事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("kickSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun kick(message: String) actual abstract suspend fun kick(message: String)

View File

@ -87,11 +87,9 @@ actual abstract class QQ : Contact(), CoroutineScope {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
@ -105,7 +103,6 @@ actual abstract class QQ : Contact(), CoroutineScope {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage
} }

View File

@ -115,7 +115,6 @@ actual open class MessageReceipt<C : Contact> actual constructor(
* 引用这条消息并回复. * 引用这条消息并回复.
* @see MessageChain.quote 引用一条消息 * @see MessageChain.quote 引用一条消息
*/ */
@JvmName("quoteReplySuspend")
@JvmSynthetic @JvmSynthetic
actual suspend fun quoteReply(message: MessageChain) { actual suspend fun quoteReply(message: MessageChain) {
target.sendMessage(this.quote() + message) target.sendMessage(this.quote() + message)

View File

@ -27,7 +27,6 @@ import net.mamoe.mirai.network.LoginFailedException
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext import kotlin.coroutines.EmptyCoroutineContext
import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic import kotlin.jvm.JvmStatic
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@ -159,7 +158,6 @@ expect abstract class Bot() : CoroutineScope, LowLevelBotAPIAccessor {
/** /**
* 挂起协程直到 [Bot] 下线. * 挂起协程直到 [Bot] 下线.
*/ */
@JvmName("joinSuspend")
@JvmSynthetic @JvmSynthetic
suspend inline fun join() suspend inline fun join()
@ -174,7 +172,6 @@ expect abstract class Bot() : CoroutineScope, LowLevelBotAPIAccessor {
* @throws LoginFailedException * @throws LoginFailedException
* @see alsoLogin * @see alsoLogin
*/ */
@JvmName("loginSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun login() abstract suspend fun login()
// endregion // endregion
@ -196,14 +193,12 @@ expect abstract class Bot() : CoroutineScope, LowLevelBotAPIAccessor {
* @see _lowLevelRecallFriendMessage 低级 API * @see _lowLevelRecallFriendMessage 低级 API
* @see _lowLevelRecallGroupMessage 低级 API * @see _lowLevelRecallGroupMessage 低级 API
*/ */
@JvmName("recallSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun recall(source: MessageSource) abstract suspend fun recall(source: MessageSource)
/** /**
* 获取图片下载链接 * 获取图片下载链接
*/ */
@JvmName("queryImageUrlSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun queryImageUrl(image: Image): String abstract suspend fun queryImageUrl(image: Image): String
@ -213,7 +208,6 @@ expect abstract class Bot() : CoroutineScope, LowLevelBotAPIAccessor {
* @see ByteReadChannel.copyAndClose * @see ByteReadChannel.copyAndClose
* @see ByteReadChannel.copyTo * @see ByteReadChannel.copyTo
*/ */
@JvmName("openChannelSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun openChannel(image: Image): ByteReadChannel abstract suspend fun openChannel(image: Image): ByteReadChannel
@ -223,7 +217,6 @@ expect abstract class Bot() : CoroutineScope, LowLevelBotAPIAccessor {
* @param message 若需要验证请求时的验证消息. * @param message 若需要验证请求时的验证消息.
* @param remark 好友备注 * @param remark 好友备注
*/ */
@JvmName("addFriendSuspend")
@JvmSynthetic @JvmSynthetic
@MiraiExperimentalAPI("未支持") @MiraiExperimentalAPI("未支持")
abstract suspend fun addFriend(id: Long, message: String? = null, remark: String? = null): AddFriendResult abstract suspend fun addFriend(id: Long, message: String? = null, remark: String? = null): AddFriendResult

View File

@ -27,7 +27,6 @@ import net.mamoe.mirai.recallIn
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext import kotlin.coroutines.EmptyCoroutineContext
import kotlin.jvm.JvmName
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@ -67,11 +66,9 @@ expect abstract class Contact() : CoroutineScope, ContactJavaHappyAPI {
* *
* @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息. * @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息.
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact> abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic @JvmSynthetic
abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact> abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>
@ -85,7 +82,6 @@ expect abstract class Contact() : CoroutineScope, ContactJavaHappyAPI {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun uploadImage(image: ExternalImage): OfflineImage abstract suspend fun uploadImage(image: ExternalImage): OfflineImage

View File

@ -154,7 +154,6 @@ expect abstract class Group() : Contact, CoroutineScope {
/** /**
* 让机器人退出这个群. 机器人必须为非群主才能退出. 否则将会失败 * 让机器人退出这个群. 机器人必须为非群主才能退出. 否则将会失败
*/ */
@JvmName("quitSuspend")
@JvmSynthetic @JvmSynthetic
@MiraiExperimentalAPI("还未支持") @MiraiExperimentalAPI("还未支持")
abstract suspend fun quit(): Boolean abstract suspend fun quit(): Boolean
@ -179,11 +178,9 @@ expect abstract class Group() : Contact, CoroutineScope {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group> abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic @JvmSynthetic
abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group> abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>
@ -197,7 +194,6 @@ expect abstract class Group() : Contact, CoroutineScope {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage

View File

@ -19,7 +19,6 @@ import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.utils.MiraiInternalAPI import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.WeakRefProperty import net.mamoe.mirai.utils.WeakRefProperty
import kotlin.jvm.JvmName
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
import kotlin.time.Duration import kotlin.time.Duration
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
@ -96,7 +95,6 @@ expect abstract class Member() : MemberJavaHappyAPI {
* @see MemberMuteEvent 成员被禁言事件 * @see MemberMuteEvent 成员被禁言事件
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun mute(durationSeconds: Int) abstract suspend fun mute(durationSeconds: Int)
@ -108,7 +106,6 @@ expect abstract class Member() : MemberJavaHappyAPI {
* @see MemberUnmuteEvent 成员被取消禁言事件. * @see MemberUnmuteEvent 成员被取消禁言事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("unmuteSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun unmute() abstract suspend fun unmute()
@ -120,7 +117,6 @@ expect abstract class Member() : MemberJavaHappyAPI {
* @see MemberLeaveEvent.Kick 成员被踢出事件. * @see MemberLeaveEvent.Kick 成员被踢出事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("kickSuspend")
@JvmSynthetic @JvmSynthetic
abstract suspend fun kick(message: String = "") abstract suspend fun kick(message: String = "")
@ -146,10 +142,8 @@ expect abstract class Member() : MemberJavaHappyAPI {
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmSynthetic @JvmSynthetic
@JvmName("sendMessageSuspend")
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member> abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>

View File

@ -28,7 +28,6 @@ import net.mamoe.mirai.message.data.OfflineFriendImage
import net.mamoe.mirai.utils.ExternalImage import net.mamoe.mirai.utils.ExternalImage
import net.mamoe.mirai.utils.MiraiExperimentalAPI import net.mamoe.mirai.utils.MiraiExperimentalAPI
import net.mamoe.mirai.utils.OverFileSizeMaxException import net.mamoe.mirai.utils.OverFileSizeMaxException
import kotlin.jvm.JvmName
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
/** /**
@ -98,10 +97,8 @@ expect abstract class QQ() : Contact, CoroutineScope {
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmSynthetic @JvmSynthetic
@JvmName("sendMessageSuspend")
abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ> abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
@ -115,7 +112,6 @@ expect abstract class QQ() : Contact, CoroutineScope {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage
} }

View File

@ -2,8 +2,8 @@
package net.mamoe.mirai package net.mamoe.mirai
import kotlinx.coroutines.io.ByteReadChannel
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.io.ByteReadChannel
import net.mamoe.mirai.contact.* import net.mamoe.mirai.contact.*
import net.mamoe.mirai.data.AddFriendResult import net.mamoe.mirai.data.AddFriendResult
import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.MessageReceipt
@ -158,7 +158,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
/** /**
* 挂起协程直到 [Bot] 下线. * 挂起协程直到 [Bot] 下线.
*/ */
@JvmName("joinSuspend")
@JvmSynthetic @JvmSynthetic
actual suspend inline fun join() = network.join() actual suspend inline fun join() = network.join()
@ -172,7 +171,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* *
* @throws LoginFailedException * @throws LoginFailedException
*/ */
@JvmName("loginSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun login() actual abstract suspend fun login()
// endregion // endregion
@ -194,14 +192,12 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @see _lowLevelRecallFriendMessage 低级 API * @see _lowLevelRecallFriendMessage 低级 API
* @see _lowLevelRecallGroupMessage 低级 API * @see _lowLevelRecallGroupMessage 低级 API
*/ */
@JvmName("recallSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun recall(source: MessageSource) actual abstract suspend fun recall(source: MessageSource)
/** /**
* 获取图片下载链接 * 获取图片下载链接
*/ */
@JvmName("queryImageUrlSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun queryImageUrl(image: Image): String actual abstract suspend fun queryImageUrl(image: Image): String
@ -211,7 +207,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @see ByteReadChannel.copyAndClose * @see ByteReadChannel.copyAndClose
* @see ByteReadChannel.copyTo * @see ByteReadChannel.copyTo
*/ */
@JvmName("openChannelSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun openChannel(image: Image): ByteReadChannel actual abstract suspend fun openChannel(image: Image): ByteReadChannel
@ -221,7 +216,6 @@ actual abstract class Bot actual constructor() : CoroutineScope, LowLevelBotAPIA
* @param message 若需要验证请求时的验证消息. * @param message 若需要验证请求时的验证消息.
* @param remark 好友备注 * @param remark 好友备注
*/ */
@JvmName("addFriendSuspend")
@JvmSynthetic @JvmSynthetic
@MiraiExperimentalAPI("未支持") @MiraiExperimentalAPI("未支持")
actual abstract suspend fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult actual abstract suspend fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult

View File

@ -62,11 +62,9 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
* *
* @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息. * @return 消息回执. [引用回复][MessageReceipt.quote]仅群聊 [撤回][MessageReceipt.recall] 这条消息.
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact> actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact> actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>
@ -80,7 +78,6 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun uploadImage(image: ExternalImage): OfflineImage actual abstract suspend fun uploadImage(image: ExternalImage): OfflineImage

View File

@ -179,11 +179,9 @@ actual abstract class Group : Contact(), CoroutineScope {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>
@ -197,7 +195,6 @@ actual abstract class Group : Contact(), CoroutineScope {
* @throws EventCancelledException 当发送消息事件被取消 * @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmName("uploadImageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineGroupImage

View File

@ -90,7 +90,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberMuteEvent 成员被禁言事件 * @see MemberMuteEvent 成员被禁言事件
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun mute(durationSeconds: Int) actual abstract suspend fun mute(durationSeconds: Int)
@ -102,7 +101,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberUnmuteEvent 成员被取消禁言事件. * @see MemberUnmuteEvent 成员被取消禁言事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun unmute() actual abstract suspend fun unmute()
@ -114,7 +112,6 @@ actual abstract class Member : MemberJavaHappyAPI() {
* @see MemberLeaveEvent.Kick 成员被踢出事件. * @see MemberLeaveEvent.Kick 成员被踢出事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmName("muteSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract suspend fun kick(message: String) actual abstract suspend fun kick(message: String)
@ -129,11 +126,9 @@ actual abstract class Member : MemberJavaHappyAPI() {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>

View File

@ -87,11 +87,9 @@ actual abstract class QQ : Contact(), CoroutineScope {
* *
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic @JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ> actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
@ -106,6 +104,5 @@ actual abstract class QQ : Contact(), CoroutineScope {
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmSynthetic @JvmSynthetic
@JvmName("uploadImageSuspend")
actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage actual abstract override suspend fun uploadImage(image: ExternalImage): OfflineFriendImage
} }

View File

@ -107,7 +107,6 @@ actual open class MessageReceipt<C : Contact> actual constructor(
* 引用这条消息并回复. * 引用这条消息并回复.
* @see MessageChain.quote 引用一条消息 * @see MessageChain.quote 引用一条消息
*/ */
@JvmName("quoteReplySuspend")
@JvmSynthetic @JvmSynthetic
actual suspend fun quoteReply(message: MessageChain) { actual suspend fun quoteReply(message: MessageChain) {
target.sendMessage(this.quote() + message) target.sendMessage(this.quote() + message)