Nonebot-plugin-alconna

Latest version: v0.46.3

Safety actively analyzes 634425 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 18

0.42.3

- 修复未增加 `onebot12` target fetcher 的问题
- 去掉 `Target` 的 dataclass 以避免 pyd 的加料

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.2...v0.42.3

0.42.2

- `Target.dump` 增加 `only_scope` 参数,设为 True则不保存 adapter 信息
- `SupportScope` 新增 `onebot12_other` 和 `satori_other`
- 从 `MsgTarget` 等获取的 target 会携带 scope 信息

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.1...v0.42.2

0.42.1

- `Target` 的 selector 与 从 scope 获得的 selector 现在是独立的(即二者会组合)
- 新增 `apply_fetch_targets`,调用后会在 nonebot 启动后为每个 bot 运行一次发送对象列表拉取
- `Target` 的 selector 的默认函数现在为从拉取到的对象列表中判断是否符合
- 新增配置项 `alconna_apply_fetch_targets`,控制是否启动时拉取一次发送对象列表
- `Target` 增加 `dump`, `load` 方法,用来存储与读取

附1:target 上 adapter,scope等的优先级为 adapter & platform > scope > selector
附2:自定义 selector:
python
async def is_friend(target: Target, bot: Bot):
if not target.private:
return False
friends = await bot.get_friend_list()
return target.id in [friend["user_id"] for friend in friends]

user_target = Target("123", private=True, selector=is_friend, adapter=SupportAdapter.onebot11)


**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.42.0...v0.42.1

0.42.0

What's Changed
* `Target` 新增属性 `selector`, `scope` 和 `platform`,原 `platform` 字段改为 `adapter`
`selector` 负责从 bots 中选择符合条件的具体 Bot 实例,`scope` 可以选择插件内置的 `selector`,`adapter`和 `platform` 用于先验条件:
python
from nonebot_plugin_alconna import Target, UniMessage, SupportAdapter, SupportScope

async def _():
所有属于 `qq协议端` 的适配器下的 bot 都是可选择的,在无更多条件时随机挑选
receipt = await Target.group("123456789", SupportScope.qq_client).send(UniMessage.image(path="test.png"))
receipt 会使用上次选择的 bot
await receipt.send(...)
此时仅选择 QQ 适配器的 bot
await Target.channel_("123456789", SupportScope.qq_api, SupportAdapter.qq).send(UniMessage.image(path="test.png"))
此时在 Satori 适配器下选择 `platform` 参数在 ["chronocat", "lark", "wecom"] 中的 bot
await Target("123456789", adapter=SupportAdapter.satori, platform={"chronocat", "lark", "wecom"}).send(UniMessage.image(path="test.png"))

* 新增 `SupportScope`:
python
qq_client = "QQClient"
"""QQ 协议端"""
qq_api = "QQAPI"
"""QQ 官方接口"""
telegram = "Telegram"
discord = "Discord"
feishu = "Feishu"
dodo = "DoDo"
kook = "Kaiheila"
minecraft = "Minecraft"
github = "GitHub"
bilibili = "Bilibili"
console = "Console"
ding = "Ding"
wechat = "WeChat"
"""微信平台"""
wechat_oap = "WeChatOfficialAccountPlatform"
"""微信公众号平台"""
wecom = "WeCom"
"""企业微信平台"""

* 为 `Receipt` 增加属性 `recallable` 和 `editable`, 用来判断是否能够撤回消息和编辑消息
* `MediaToUrl` 函数增加参数 `bot: Bot`
* 修复合并转发在 onebot11 下的发送
* `get_bot` 可以传入 `predicate` 参数,原 `adapter` 作为构建 predicate 的便捷方式
* ⬆️ Bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 by dependabot in https://github.com/nonebot/plugin-alconna/pull/42
* :arrow_up: auto update by pre-commit hooks by pre-commit-ci in https://github.com/nonebot/plugin-alconna/pull/44


**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.41.1...v0.42.0

0.41.1

- 增加配置项:
- ALCONNA_ENABLE_SAA_PATCH: 是否启用 SAA 补丁
- ALCONNA_APPLY_FILEHOST: 是否启用文件托管
- 为 nonebug 的 fake 适配器提供基础支持

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.41.0...v0.41.1

0.41.0

- 新增方法 `apply_media_to_url` ,允许用户传入一个负责将文件path或bytes数据转为url的异步函数给Media类使用
- 选择方法 `apply_filehost`,会使用 [`nonebot-plugin-filehost`](https://github.com/nonebot/plugin-filehost) 来实现 apply_media_to_url

**Full Changelog**: https://github.com/nonebot/plugin-alconna/compare/v0.40.1...v0.41.0

Page 3 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.