feat: add latest commmit info and add language name on github repo card
This commit is contained in:
4 files changed
+91
-1
No files matched your search
@@ -111,6 +111,8 @@ object GitHubParseCommand {
|
||||
g2d.drawString(repoStat.description ?: "暂无描述~", 80, 400, 800)
|
||||
val avatarImage = ImageIO.read(URI(repoStat.owner.avatarUrl).toURL())
|
||||
g2d.drawCustomImage(avatarImage, 1200, 160, 300.0, 300.0, true)
|
||||
g2d.color = this.getLanguageColor(repoStat.language)
|
||||
g2d.drawString(repoStat.language, 30, CANVAS_HEIGHT - 50)
|
||||
g2d.dispose()
|
||||
return canvas.toByteArray().encodeToBase64()
|
||||
}
|
||||
@@ -123,4 +125,10 @@ object GitHubParseCommand {
|
||||
.build()
|
||||
message.reply(msg)
|
||||
}
|
||||
|
||||
fun creatRepoImage(user: String, repo: String): String {
|
||||
val repoStat = this.getRepoStat(user, repo)
|
||||
val image = this.createImage(repoStat)
|
||||
return image
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user