entrylib icon indicating copy to clipboard operation
entrylib copied to clipboard

[Feature Request]希望能兼容overflow

Open SnowMoonSS opened this issue 1 year ago • 0 comments

需求描述 Descibe the feature
希望能兼容overflow

这是否是一个突破性变化?Is this a breaking changes?

  • [x] 请选中本复选框表示这是一个突破性变化

附加内容 Additional context
现在的mirai登录非常困难,有dalao做了把mirai对接到onebot协议上的overflow,于是就可以在llonebotnapcat使用mirai了。但是目前的entrylib不太兼容overflow,消息中有图片时,后台会报错,也无法正常学习带有图片的消息,学习之后触发出来会变成mirai码的样子

收到图片时的报错:

2024-07-25 12:54:01 V/Bot.1234567890: [XXXXX(123456789)] XXXXX(1234567890) -> [overflow:image,url=https://gchat.qpic.cn/gchatpic_new/3805650
13/993122529-3147376866-EBE332DEB5FDF82C01A61996C31B7896/0?term=255&is_origin=0]
2024-07-25 12:54:02 W/stderr: java.io.FileNotFoundException: /home/snowmoonss/overflow/data/com.billyang.entrylib/images/https:/gchat.qpic.cn/gchatpic_new/3805
65013/993122529-3147376866-EBE332DEB5FDF82C01A61996C31B7896/0?term=255&is_origin=0 (没有那个文件或目录)
2024-07-25 12:54:02 W/stderr:   at java.base/java.io.FileOutputStream.open0(Native Method)
2024-07-25 12:54:02 W/stderr:   at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
2024-07-25 12:54:02 W/stderr:   at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
2024-07-25 12:54:02 W/stderr:   at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:184)
2024-07-25 12:54:02 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.ImageParser.downloadImage(ImageParser.java:62)
2024-07-25 12:54:02 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.ImageParser.Image2PlainText(ImageParser.java:111)
2024-07-25 12:54:02 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.CodeParser.Encode(CodeParser.java:69)
2024-07-25 12:54:02 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.EntryLib.lambda$onEnable$0(EntryLib.java:637)
2024-07-25 12:54:02 W/stderr:   at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
2024-07-25 12:54:02 W/stderr:   at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43)
2024-07-25 12:54:02 W/stderr:   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
2024-07-25 12:54:02 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

学习内容有图片时:

2024-07-25 12:56:50 V/Bot.1234567890: [XXXXX(123456789)] XXXXXX(123456789) -> 学习#图片#[overflow:image,url=https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=Cgk5NzY3MjIwOTQSFAjKAQ4sNDp_IPXjuL4aoCd-LmohGPXjAyD_Ciiq9YPIs8GHA1CAvaMB&spec=0&rkey=CAISKKSBekjVG1fMutsH-LYuZW2KRmiC-p9NSm7BWbJXmp1jC-OIiUCc8tQ]
2024-07-25 12:56:51 W/stderr: java.io.FileNotFoundException: /home/snowmoonss/overflow/data/com.billyang.entrylib/images/https:/multimedia.nt.qq.com.cn/download?appid=1407&fileid=Cgk5NzY3MjIwOTQSFAjKAQ4sNDp_IPXjuL4aoCd-LmohGPXjAyD_Ciiq9YPIs8GHA1CAvaMB&spec=0&rkey=CAISKKSBekjVG1fMutsH-LYuZW2KRmiC-p9NSm7BWbJXmp1jC-OIiUCc8tQ (没有那个文件或目录)
2024-07-25 12:56:51 W/stderr:   at java.base/java.io.FileOutputStream.open0(Native Method)
2024-07-25 12:56:51 W/stderr:   at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
2024-07-25 12:56:51 W/stderr:   at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
2024-07-25 12:56:51 W/stderr:   at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:184)
2024-07-25 12:56:51 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.ImageParser.downloadImage(ImageParser.java:62)
2024-07-25 12:56:51 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.ImageParser.Image2PlainText(ImageParser.java:111)
2024-07-25 12:56:51 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.MiraiCodeParser.CodeParser.Encode(CodeParser.java:69)
2024-07-25 12:56:51 W/stderr:   at mirai-entrylib-1.3.2.mirai.jar//com.billyang.entrylib.EntryLib.lambda$onEnable$0(EntryLib.java:637)
2024-07-25 12:56:51 W/stderr:   at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
2024-07-25 12:56:51 W/stderr:   at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43)
2024-07-25 12:56:51 W/stderr:   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
2024-07-25 12:56:51 W/stderr:   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
2024-07-25 12:56:51 I/EntryLib: Got Input Command: learn
2024-07-25 12:56:51 V/Bot.1234567890: Group(123456789) <- 已更新 图片 词条!

触发刚才学习的图片,直接发出了mirai码

2024-07-25 12:58:11 V/Bot.1234567980: [XXXXX(123456789)] XXXXX(123456789) -> 图片
2024-07-25 12:58:11 V/Bot.1234567890: Group(123456789) <- [mirai:image:https://multimedia.nt.qq.com.cn/download?appid=1407&fileid=Cgk5NzY3MjIwOTQSFAjKAQ4sNDp_IPXjuL4aoCd-LmohGPXjAyD_Ciiq9YPIs8GHA1CAvaMB&spec=0&rkey=CAISKKSBekjVG1fMutsH-LYuZW2KRmiC-p9NSm7BWbJXmp1jC-OIiUCc8tQ]

不使用overflow时学习的消息会这样正常发出来

2024-07-25 12:59:46 V/Bot.1234657980: [XXXXX(132456798)] XXXXX(123465789) -> 萝卜
2024-07-25 12:59:47 V/Bot.1324567980: Group(123465798) <- [overflow:image,url=file:///home/snowmoonss/overflow/data/com.billyang.entrylib/images/{3445598D-7299-BF80-1B2E-ACDB26ED09DB}.gif]

SnowMoonSS avatar Jul 25 '24 05:07 SnowMoonSS