Him188 %!s(int64=5) %!d(string=hai) anos
pai
achega
2d96314d72

+ 4 - 0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Member.kt

@@ -162,22 +162,26 @@ abstract class Member : MemberJavaFriendlyAPI() {
  *
  * @throws IllegalStateException 当此成员不是好友时抛出
  */
+@SinceMirai("0.39.0")
 fun Member.asFriend(): Friend = this.bot.getFriendOrNull(this.id) ?: error("$this is not a friend")
 
 /**
  * 得到此成员作为好友的对象.
  */
+@SinceMirai("0.39.0")
 fun Member.asFriendOrNull(): Friend? = this.bot.getFriendOrNull(this.id)
 
 /**
  * 判断此成员是否为好友
  */
+@SinceMirai("0.39.0")
 inline val Member.isFriend: Boolean
     get() = this.bot.friends.contains(this.id)
 
 /**
  * 如果此成员是好友, 则执行 [block] 并返回其返回值. 否则返回 `null`
  */
+@SinceMirai("0.39.0")
 inline fun <R> Member.takeIfIsFriend(block: (Friend) -> R): R? {
     return this.asFriendOrNull()?.let(block)
 }

+ 1 - 1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt

@@ -263,7 +263,7 @@ annotation class ForwardMessageDsl
  *     123456789 named "鸽子 A" says "咕" // 意为 名为 "鸽子 A" 的用户 123456789 发送了一条内容为 "咕" 的消息
  *     100200300 named "鸽子 C" at 1582315452 says "咕咕咕" // at 设置时间 (在 PC 端显示, 在手机端不影响顺序)
  *     987654321 named "鸽子 B" says "咕" // 未指定时间, 则自动顺序安排时间
- *     5555555 says "咕" // 未指定发送人
+ *     myFriend says "咕" // User.says
  *     bot says { // 构造消息链, 同 `buildMessageChain`
  *         +"发个图片试试"
  *         +Image("{90CCED1C-2D64-313B-5D66-46625CAB31D7}.jpg")