-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
<>及其包裹的内容是具体信息
OneBotForwardNode指定UserID、Nickname无效,发送后显示的头像、名字始终与Bot相同。
implementation("love.forte.simbot:simbot-core-spring-boot-starter:4.3.1")
implementation("love.forte.simbot.component:simbot-component-onebot-v11-core:1.0.1") @Listener
@Filter(".test forward")
suspend fun OneBotMessageEvent.testForward() {
val node = OneBotForwardNode.create(
userId = <user_id>.ID,
nickname = "<nickname>",
content = listOf(
OneBotText.create(
"测试"
)
)
)
send(node.toElement())
}// 上文中的send函数
suspend fun OneBotMessageEvent.send(message: Message) {
when(this) {
is OneBotGroupMessageEvent -> content().send(message)
is OneBotFriendMessageEvent -> content().send(message)
else -> reply(message)
}
}下文与问题无关
另外,在使用GoCq作为OB服务端时报错:
[2024-07-29 20:32:37] [WARNING]: 转换消息 [CQ:node,user_id=<user_id>,nickname=<nickname>,content=[{"type":"text","data":{"text":"测试"}}]] 到MiraiGo Element时出现错误: unsupported message type: node.
[2024-07-29 20:32:37] [WARNING]: 群 <group_id> 消息发送失败: 消息为空.
查看其文档时,发现GoCq定义API/send_group_forward_msg、/send_private_forward_msg用于发送转发消息
Metadata
Metadata
Assignees
Labels
No labels