nonebot-plugin-send-anything-anywhere
nonebot-plugin-send-anything-anywhere copied to clipboard
AllSupportedPlatformTarget的判断问题
目前 AllSupportedPlatformTarget 是一个泛型 https://github.com/MountainDash/nonebot-plugin-send-anything-anywhere/blob/cdd96b4b498bab6995151315f183bb3f81ddf8d1/nonebot_plugin_saa/registries/platform_send_target.py#L265-L279 无法做到判断 Platfrom.deserialize 结果为 AllSupportedPlatformTarget, 例如: https://github.com/MountainDash/nonebot-bison/blob/2fc6e253f3488cd6aa7a1f7b5e76b37297be2d04/nonebot_bison/config/subs_io/nbesf_model/v2.py#L36-L41 https://github.com/MountainDash/nonebot-bison/blob/2fc6e253f3488cd6aa7a1f7b5e76b37297be2d04/nonebot_bison/config/subs_io/subs_io.py#L43-L49 能否提供一个
def is_supported_platform_target(target: PlatformTarget) -> TypeGuard[AllSupportedPlatformTarget]:
...
工具来做到这件事