From 67f7be34a317db686740d91085c30496a6060482 Mon Sep 17 00:00:00 2001 From: sandtechnology <20417547+sandtechnology@users.noreply.github.com> Date: Thu, 16 Apr 2020 01:21:54 +0800 Subject: [PATCH] Fix wrong error message --- mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt index 07e1cede9..75580a14d 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt @@ -115,7 +115,7 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI( * 获取一个好友对象. * @throws [NoSuchElementException] 当不存在这个好友时抛出 */ - fun getFriend(id: Long): QQ = friends.firstOrNull { it.id == id } ?: throw NoSuchElementException("group $id") + fun getFriend(id: Long): QQ = friends.firstOrNull { it.id == id } ?: throw NoSuchElementException("friend $id") /** * 机器人加入的群列表. 与服务器同步更新 @@ -343,4 +343,4 @@ inline fun Bot.containsGroup(id: Long): Boolean = this.groups.contains(id) inline fun Bot.getFriendOrNull(id: Long): QQ? = this.friends.getOrNull(id) @JvmSynthetic -inline fun Bot.getGroupOrNull(id: Long): Group? = this.groups.getOrNull(id) \ No newline at end of file +inline fun Bot.getGroupOrNull(id: Long): Group? = this.groups.getOrNull(id)