Skip to content

Commit

Permalink
remove some unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Fudster committed Jan 9, 2025
1 parent ee8ed92 commit 471d83a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/pydiscordsh/pydiscordsh/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def validate_invite(cls, value):
discord_invite_pattern = r"(?:https?://(?:www\.)?discord(?:\.com)?/invite/|discord\.gg/)([a-zA-Z0-9_-]+)"
match = re.match(discord_invite_pattern, value)
if match:
return match.group(1) # Return only the invite code
return match.group(1)
if re.match(r"^[a-zA-Z0-9_-]{1,100}$", value):
return value # Return the raw invite code if valid
return value
raise ValueError("Invalid invite link or invite code.")

@validator("categories", pre=True, always=True)
Expand Down

0 comments on commit 471d83a

Please sign in to comment.