Skip to content

Nonebot Plugin Alconna 0.27.0

Compare
Choose a tag to compare
@RF-Tar-Railt RF-Tar-Railt released this 09 Oct 07:56
· 362 commits to master since this release

新增:

  • 适配 Satori 适配器
  • 类似 telegram, satori 同样支持富文本解析:
    from nonebot.adapters.satori import Message
    from nonebot_plugin_alconna.adapters.satori import Bold, Underline
    
    msg = Message("/com<b>mand some_arg</b> <u>some_arg</u> some_arg")
    
    alc = Alconna("/command", Args["some_arg", Bold]["some_arg1", Underline]["some_arg2", str])
    
    res = alc.parse(msg)
    assert res.matched
    assert res.some_arg.data["style"] == "b"
    assert res.some_arg1.data["style"] == "u"
    assert isinstance(res.some_arg2, str)

Full Changelog: v0.26.1...v0.27.0