Kaynağa Gözat

Add avatarUrl, close #102

Him188 6 yıl önce
ebeveyn
işleme
1ff5df1d30

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

@@ -117,6 +117,10 @@ interface Group : Contact, CoroutineScope {
      */
     val botPermission: MemberPermission
 
+    /**
+     * 群头像下载链接.
+     */
+    val avatarUrl: String get() = "https://p.qlogo.cn/gh/$id/${id}_1/640"
 
     /**
      * 群成员列表, 不含机器人自己, 含群主.

+ 5 - 0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/QQ.kt

@@ -58,6 +58,11 @@ interface QQ : Contact, CoroutineScope {
     @MiraiExperimentalAPI("还未支持")
     suspend fun queryProfile(): Profile
 
+    /**
+     * 头像下载链接
+     */
+    val avatarUrl: String get() = "http://q1.qlogo.cn/g?b=qq&nk=$id&s=640"
+
     /**
      * 查询曾用名.
      *