Repository: Pycord-Development/pycord

Issue:
ctx.guild.create_sticker yields 400 bad request when optional parameter description is not used. 
### Summary

Pycord docs mention that parameter description is  optional, however not using it in the parameters yields 400 bad request response. 

### Reproduction Steps

create a bot command using the ctx: commands.Context parameters

```py
@bot.command(name="test", description="Admin only")
async def test(ctx: commands.Context):
    file = discord.File("userelo.png")
    await ctx.guild.create_sticker(name="dada", emoji="skull", file=file)
    await ctx.respond("created")
```

Once user invokes the command /test

Error log will show :
```py
Ignoring exception in command test:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/commands/core.py", line 127, in wrapped
    ret = await coro(arg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/commands/core.py", line 881, in _invoke
    await self.callback(ctx, **kwargs)
  File "/Users/andykilgore/PycharmProjects/CODStats/Bot.py", line 1770, in test
    await ctx.guild.create_sticker(name="dada", emoji="skull", file=file)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/guild.py", line 2476, in create_sticker
    data = await self._state.http.create_guild_sticker(self.id, payload, file, reason)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 360, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 0): The browser (or proxy) sent a request that this server could not understand.
```

### Minimal Reproducible Code

```python
@bot.command(name="test", description="Admin only")
async def test(ctx: commands.Context):
    file = discord.File("userelo.png")
    await ctx.guild.create_sticker(name="dada", emoji="skull", file=file)
    await ctx.respond("created")
```


### Expected Results

Since description is an optional parameter in the docs,

 1. It should not be required when invoking the ctx.guild.create_sticker function. Not including description should not raise an error and should instead create the sticker. 
 
 OR 
 
 2. docs should be updated to specify description is an required parameter. 

### Actual Results

If description is not included in the parameters, function responds with the following error message:

![image](https://user-images.githubusercontent.com/92450298/182038466-b003088f-6572-4a0a-aa21-9added9629b7.png)


### Intents

intents = discord.Intents.default() intents.members = True intents = discord.Intents().all()

### System Information

Python : 3.9
Mac OS Ventura PB 1 

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

await ctx.guild.create_sticker(name="dada", description="test", emoji="skull", file=file)


this works fine but like I stated, description should be optional according to https://docs.pycord.dev/en/master/api.html?highlight=sticker#discord.Guild.create_sticker

Thanks!


Discussion:

Resolving patch:
diff --git a/discord/guild.py b/discord/guild.py
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -2431,9 +2431,9 @@ async def create_sticker(
         Parameters
         -----------
         name: :class:`str`
-            The sticker name. Must be at least 2 characters.
+            The sticker name. Must be 2 to 30 characters.
         description: Optional[:class:`str`]
-            The sticker's description. Can be ``None``.
+            The sticker's description. If used, must be 2 to 100 characters.
         emoji: :class:`str`
             The name of a unicode emoji that represents the sticker's expression.
         file: :class:`File`
@@ -2447,19 +2447,25 @@ async def create_sticker(
             You are not allowed to create stickers.
         HTTPException
             An error occurred creating a sticker.
+        TypeError
+            The parameters for the sticker are not correctly formatted.
 
         Returns
         --------
         :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 or ""
         }
 
-        if description:
-            payload["description"] = description
-
         try:
             emoji = unicodedata.name(emoji)
         except TypeError:


Test patch: