feat: add short url and origin url
This commit is contained in:
1 file changed
+7
-2
@@ -89,8 +89,13 @@ class FancyBot : OneBotListener {
|
|||||||
try {
|
try {
|
||||||
val imageByteArray = imageUrl.toURL().readBytes()
|
val imageByteArray = imageUrl.toURL().readBytes()
|
||||||
val imageFileType = imageByteArray.getFileType()
|
val imageFileType = imageByteArray.getFileType()
|
||||||
val imageBedUrl = ImageBed.upload(imageByteArray, imageFileType).makeShortLink()
|
val imageBedUrl = ImageBed.upload(imageByteArray, imageFileType)
|
||||||
message.reply(imageBedUrl)
|
val msg = MessageChain.Builder()
|
||||||
|
.addText(imageBedUrl.makeShortLink())
|
||||||
|
.addNewLine(2)
|
||||||
|
.addText(imageBedUrl)
|
||||||
|
.build()
|
||||||
|
message.reply(msg)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
message.reply("上传失败~")
|
message.reply("上传失败~")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user