nonebot / adapter-discord

NoneBot2 Discord 适配器 / Discord adapter for nonebot2
20 stars 6 forks source link

解析 `GuildCreateEvent` 时抛出 `ValidationError` #3

Closed jks15satoshi closed 11 months ago

jks15satoshi commented 1 year ago
pydantic.error_wrappers.ValidationError: 2 validation errors for ParsingModel[GuildCreateEvent]
__root__ -> features
  unexpected value; permitted: <UNSET> (type=value_error.const; given=['SOUNDBOARD']; permitted=(<UNSET>,))
__root__ -> features -> 0
  value is not a valid enumeration member; permitted: ...

看起来似乎是 SOUNDBOARD 没有列进 GuildFeature 里,不过官方文档里也没写,也不知道直接加进去合不合适,姑且先提个 issue(感觉大概率 wontfix)。

Edit: 补充事件信息

{
    "latest_onboarding_question_id": None,
    "voice_states": [],
    "splash": None,
    "vanity_url_code": None,
    "verification_level": 0,
    "lazy": True,
    "guild_scheduled_events": [],
    "incidents_data": None,
    "unavailable": False,
    "embedded_activities": [],
    "public_updates_channel_id": None,
    "mfa_level": 0,
    "hub_type": None,
    "max_stage_video_channel_users": 50,
    "icon": None,
    "system_channel_flags": 0,
    "owner_id": ...,
    "banner": None,
    "afk_timeout": 300,
    "premium_progress_bar_enabled": True,
    "id": ...,
    "description": None,
    "presences": [
        ...
    ],
    "channels": [
        ...
    ],
    "default_message_notifications": 0,
    "explicit_content_filter": 0,
    "member_count": 7,
    "nsfw": False,
    "members": [
        ...
    ],
    "safety_alerts_channel_id": None,
    "threads": [],
    "large": False,
    "guild_hashes": {
        "version": 1,
        "roles": {"omitted": False, "hash": "rFJ8AQ"},
        "metadata": {"omitted": False, "hash": "oBV/fQ"},
        "channels": {"omitted": False, "hash": "nAXjDg"},
    },
    "system_channel_id": ...,
    "preferred_locale": "en-US",
    "rules_channel_id": None,
    "application_command_counts": {},
    "emojis": [
        ...
    ],
    "inventory_settings": None,
    "premium_tier": 0,
    "premium_subscription_count": 0,
    "stickers": [],
    "joined_at": "2023-08-27T04:34:10.571371+00:00",
    "max_members": 500000,
    "features": ["SOUNDBOARD"],
    "roles": [
        ...
    ],
    "name": ...,
    "afk_channel_id": None,
    "home_header": None,
    "discovery_splash": None,
    "application_id": None,
    "stage_instances": [],
    "region": "deprecated",
    "max_video_channel_users": 25,
    "nsfw_level": 0,
}
jks15satoshi commented 1 year ago

他们文档仓库里倒是有关于 SOUNDBOARD提交记录,不过还没合并,或许可以参考一下。

CMHopeSunshine commented 11 months ago

b60914ea953aa25ecca88cf933300d41af119f56 已补充,有空帮忙试试还有没有其他缺漏,感谢~

jks15satoshi commented 11 months ago

抱歉迟了这么久回复。暂时还没有发现其他遗漏的,我认为可以先 close issue 了。如果有发现再 reopen 吧。