simple-robot / simpler-robot

Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
https://simbot.forte.love
GNU Lesser General Public License v3.0
520 stars 43 forks source link

v3版本的语音消息对应Message下的哪个实体类 #400

Closed enchantedyou closed 2 years ago

enchantedyou commented 2 years ago

版本号

3.0.0-beta-RC-SNAPSHOT

疑问描述

不计划用猫猫码的方式发送语音消息,如果用实体类的话,是用Message下的RemoteResource吗 https://simple-robot-library.github.io/simbot3-main-apiDoc/v3.0.0.preview.20.0/simbot-apis/simbot-api/love.forte.simbot.message/-remote-resource/index.html

ForteScarlet commented 2 years ago

语音消息不属于标准库,当一个组件支持语音消息时,将会由组件提供额外实现。

例如在mirai组件中:

enchantedyou commented 2 years ago

simbot-component-mirai:v3.0.0.0-beta-M2-SNAPSHOT 我通过第一种方式构建语音消息,但是发送后qq无法识别,已确认语音url能够在浏览器播放 image image _%DH_SGJVS2B81IPKQ{IA E

ForteScarlet commented 2 years ago

see #103

其他可能参考:https://github.com/mamoe/mirai/issues?q=%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF

enchantedyou commented 2 years ago

了解了,我后续用第三方包转换下

SmallWhitedawsd commented 1 year ago

PathResource resource = Resource.of(Paths.get("src/main/resources/static/video/output.wav")); MiraiSendOnlyAudio audioMessage = new MiraiSendOnlyAudio(love.forte.simbot.resources.Resource.of(resource.getPath())); event.getSource().sendBlocking(audioMessage);