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

Improve sticker creation checks #1546

Merged
merged 8 commits into from
Aug 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Actually fix sticker descriptions
  • Loading branch information
Middledot committed Aug 6, 2022
commit fe394e2e12cbc35ca71db41567e9e5b1a1f06742
8 changes: 7 additions & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -2453,9 +2453,15 @@ async def create_sticker(
:class:`GuildSticker`
The created sticker.
"""
if not (2 <= len(name) <= 30):
raise TypeError("\"name\" parameter must be 2 to 30 characters long.")

if description and not (2 <= len(description) <= 100):
raise TypeError("\"description\" parameter must be 2 to 200 characters long.")

payload = {
"name": name,
"description": description
"description": description or ""
}

try:
Expand Down