Skip to content

Commit d1caaa7

Browse files
authored
fix: address issues with tag usage for guild forums (#1499)
* fix: address issues with tags for guild forums * fix: is this breaking? better be safe than sorry
1 parent 364aa69 commit d1caaa7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

interactions/models/discord/channel.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,7 +2420,7 @@ async def create_post(
24202420
self,
24212421
name: str,
24222422
content: str | None,
2423-
applied_tags: Optional[List[Union["Snowflake_Type", "ThreadTag", str]]] = MISSING,
2423+
applied_tags: Absent[List[Union["Snowflake_Type", "ThreadTag", str]]] = MISSING,
24242424
*,
24252425
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
24262426
rate_limit_per_user: Absent[int] = MISSING,
@@ -2463,7 +2463,7 @@ async def create_post(
24632463
Returns:
24642464
A GuildForumPost object representing the created post.
24652465
"""
2466-
if applied_tags != MISSING:
2466+
if applied_tags is not MISSING:
24672467
processed = []
24682468
for tag in applied_tags:
24692469
if isinstance(tag, ThreadTag):
@@ -2568,12 +2568,13 @@ def get_tag(self, value: str | Snowflake_Type, *, case_insensitive: bool = False
25682568
Returns:
25692569
A ThreadTag object representing the tag.
25702570
"""
2571+
value = str(value)
25712572

25722573
def maybe_insensitive(string: str) -> str:
25732574
return string.lower() if case_insensitive else string
25742575

25752576
def predicate(tag: ThreadTag) -> Optional["ThreadTag"]:
2576-
if str(tag.id) == str(value):
2577+
if str(tag.id) == value:
25772578
return tag
25782579
if maybe_insensitive(tag.name) == maybe_insensitive(value):
25792580
return tag

0 commit comments

Comments
 (0)