Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加更多 GuildFeature 类型 #20

Merged
merged 2 commits into from
Mar 25, 2024
Merged

添加更多 GuildFeature 类型 #20

merged 2 commits into from
Mar 25, 2024

Conversation

Autuamn
Copy link
Contributor

@Autuamn Autuamn commented Mar 25, 2024

根据 https://github.com/Delitefully/DiscordLists

我收到的 Features:

'features': [
    "GUILD_ONBOARDING_HAS_PROMPTS",
    "COMMUNITY",
    "GUILD_ONBOARDING",
    "GUILD_ONBOARDING_EVER_ENABLED",
    "NEWS",
    "ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY",
    "CHANNEL_ICON_EMOJIS_GENERATED",
]

其中有5个不在写明的 Features 里

遂尝试添加更多 Features

Log
Traceback (most recent call last):
  File "<string>", line 25, in <module>
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/__init__.py", line 334, in run
    get_driver().run(*args, **kwargs)
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/drivers/none.py", line 56, in run
    loop.run_until_complete(self._serve())
  File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
    handle._run()
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/adapters/discord/adapter.py", line 213, in _forward_ws
    await self._loop(bot, ws)
> File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/adapters/discord/adapter.py", line 384, in _loop
    event = self.payload_to_event(payload)
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/adapters/discord/adapter.py", line 448, in payload_to_event
    return type_validate_python(EventClass, payload.data)
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/nonebot/compat.py", line 215, in type_validate_python
    return TypeAdapter(type_).validate_python(data)
  File "/home/ubuntu/JYstore-Tultle/.venv/lib/python3.10/site-packages/pydantic/type_adapter.py", line 258, in validate_python
    return self.validator.validate_python(__object, strict=strict, from_attributes=from_attributes, context=context)
pydantic_core._pydantic_core.ValidationError: 6 validation errors for GuildCreateEvent
features.literal[<UNSET>]
  Input should be <UNSET> [type=literal_error, input_value=['GUILD_ONBOARDING_HAS_PR..._ICON_EMOJIS_GENERATED'], input_type=list]
    For further information visit https://errors.pydantic.dev/2.6/v/literal_error
features.list[lax-or-strict[lax=chain[str,function-plain[to_enum()]],strict=json-or-python[json=function-after[to_enum(), str],python=is-instance[GuildFeature]]]].0
  Input should be 'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'FEATURABLE', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED' or 'SOUNDBOARD' [type=enum, input_value='GUILD_ONBOARDING_HAS_PROMPTS', input_type=str]
features.list[lax-or-strict[lax=chain[str,function-plain[to_enum()]],strict=json-or-python[json=function-after[to_enum(), str],python=is-instance[GuildFeature]]]].2
  Input should be 'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'FEATURABLE', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED' or 'SOUNDBOARD' [type=enum, input_value='GUILD_ONBOARDING', input_type=str]
features.list[lax-or-strict[lax=chain[str,function-plain[to_enum()]],strict=json-or-python[json=function-after[to_enum(), str],python=is-instance[GuildFeature]]]].3
  Input should be 'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'FEATURABLE', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED' or 'SOUNDBOARD' [type=enum, input_value='GUILD_ONBOARDING_EVER_ENABLED', input_type=str]
features.list[lax-or-strict[lax=chain[str,function-plain[to_enum()]],strict=json-or-python[json=function-after[to_enum(), str],python=is-instance[GuildFeature]]]].5
  Input should be 'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'FEATURABLE', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED' or 'SOUNDBOARD' [type=enum, input_value='ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY', input_type=str]
features.list[lax-or-strict[lax=chain[str,function-plain[to_enum()]],strict=json-or-python[json=function-after[to_enum(), str],python=is-instance[GuildFeature]]]].6
  Input should be 'ANIMATED_BANNER', 'ANIMATED_ICON', 'APPLICATION_COMMAND_PERMISSIONS_V2', 'AUTO_MODERATION', 'BANNER', 'COMMUNITY', 'CREATOR_MONETIZABLE_PROVISIONAL', 'CREATOR_STORE_PAGE', 'DEVELOPER_SUPPORT_SERVER', 'DISCOVERABLE', 'FEATURABLE', 'INVITES_DISABLED', 'INVITE_SPLASH', 'MEMBER_VERIFICATION_GATE_ENABLED', 'MORE_STICKERS', 'NEWS', 'PARTNERED', 'PREVIEW_ENABLED', 'ROLE_ICONS', 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE', 'ROLE_SUBSCRIPTIONS_ENABLED', 'TICKETED_EVENTS_ENABLED', 'VANITY_URL', 'VERIFIED', 'VIP_REGIONS', 'WELCOME_SCREEN_ENABLED' or 'SOUNDBOARD' [type=enum, input_value='CHANNEL_ICON_EMOJIS_GENERATED', input_type=str]

@CMHopeSunshine CMHopeSunshine marked this pull request as ready for review March 25, 2024 05:40
@CMHopeSunshine CMHopeSunshine merged commit 70b10a5 into nonebot:master Mar 25, 2024
1 of 2 checks passed
@Autuamn Autuamn deleted the patch-1 branch March 25, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants