From d6cbc0bf9e7bd98d102976e5668ff13d0873904e Mon Sep 17 00:00:00 2001 From: ReRubis Date: Fri, 29 Dec 2023 23:15:02 +0000 Subject: [PATCH] Move ForumTag to channel_data Signed-off-by: ReRubis --- asyncord/client/models/channels.py | 39 +++--------------------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/asyncord/client/models/channels.py b/asyncord/client/models/channels.py index 5abfb8e..5078260 100644 --- a/asyncord/client/models/channels.py +++ b/asyncord/client/models/channels.py @@ -7,15 +7,16 @@ from __future__ import annotations from datetime import datetime -from typing import Annotated, Any +from typing import Annotated -from pydantic import BaseModel, Field, ValidationInfo, field_validator, model_validator +from pydantic import BaseModel, Field, ValidationInfo, field_validator from asyncord.client.models.channel_data import ( ChannelFlag, ChannelType, DefaultForumLayoutType, DefaultReaction, + ForumTag, Overwrite, ThreadSortOrder, ) @@ -307,37 +308,3 @@ class ChannelMention(BaseModel): name: str """Channel name.""" - - -class ForumTag(BaseModel): - """Forum tag representation. - - Read more info at: - https://discord.com/developers/docs/resources/channel#forum-tag-object - """ - - id: Snowflake - """Tag id.""" - - name: str = Field(min_length=0, max_length=20) - """Tag name. - - Should be between 0 and 20 characters. - """ - - moderated: bool - """Whether this tag can only be used a member with the MANAGE_THREADS permission.""" - - emoji_id: Snowflake | None - """Id of a guild's custom emoji.""" - - emoji_name: str | None - """Unicode character of the emoji.""" - - @model_validator(mode='before') - def validate_emoji_id_or_name(cls, values: dict[str, Any]) -> dict[str, Any]: - """Validate that only one of emoji_id and emoji_name is set.""" - if 'emoji_id' in values and 'emoji_name' in values: - raise ValueError('At most one of emoji_id and emoji_name may be set.') - - return values