Skip to content

Commit

Permalink
Merge pull request #17 from Decrabbityyy/qwq
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 authored Sep 24, 2024
2 parents 3304b28 + 218f812 commit 351a02e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/Lagrange.OneBot/API/Extend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,14 @@
::: code-group

```python{10-11} [Nonebot OneBot V11]
from nonebot.adapters.onebot.v11 import MessageSegment
async def test_send_forward_message(target_id: int):
messages = [
{
"type": "node",
"data": {"name": "小助手", "uin": "2854196310", "content": [MessageSegment.text("测试消息")]},
}
]
res_id = await bot.call_api("send_forward_msg", messages=messages)
await bot.send_group_msg(group_id=target_id, message=MessageSegment.forward(res_id))
from nonebot.adapters.onebot.v11 import MessageSegment, Message, Bot
async def test_send_forward_message(bot: Bot, target_id: int):
messages = MessageSegment.node_custom(
user_id=2854196310, nickname="小助手", content=Message(MessageSegment.text("测试消息"))
)
res_id = await bot.call_api("send_forward_msg", messages=Message(messages))
await bot.send_group_msg(group_id=target_id, message=Message(MessageSegment.forward(res_id)))
```

:::
Expand Down

0 comments on commit 351a02e

Please sign in to comment.