Repository: Pycord-Development/pycord

Issue:
send(suppress=True) causes TypeError: Type is not JSON serializable: flag_value
### Summary

I upgraded to v2.2.1 and edited my code to use .send(suppress=True) instead of a combo of send & edit(suppress=True). Such change prompted the exception described in the title. I think addition of suppress to sending isn't working correctly.

### Reproduction Steps

1. Get a channel (in my case it's a thread, but I doubt that would be much different?)
2. Have a working code as follows:
    ```python
    message = await channel.send(content='blah blah https://junior.guru/handbook/cv/')
    await message.edit(suppress=True)
    ```
3. Upgrade to v2.2.1 or v2.2.2 (doesn't matter) and rewrite code to following:
    ```python
    await channel.send(content='blah blah https://junior.guru/handbook/cv/', suppress=True)
    ```
4. Get this exception:
    ```
    ...
        await thread.send(content=content, suppress=True)
    File "/Users/honza/Library/Caches/pypoetry/virtualenvs/juniorguru-Lgaxwd2n-py3.10/lib/python3.10/site-packages/discord/abc.py", line 1580, in send
        data = await state.http.send_message(
    File "/Users/honza/Library/Caches/pypoetry/virtualenvs/juniorguru-Lgaxwd2n-py3.10/lib/python3.10/site-packages/discord/http.py", line 240, in request
        kwargs["data"] = utils._to_json(kwargs.pop("json"))
    File "/Users/honza/Library/Caches/pypoetry/virtualenvs/juniorguru-Lgaxwd2n-py3.10/lib/python3.10/site-packages/discord/utils.py", line 599, in _to_json
        return orjson.dumps(obj).decode("utf-8")
    TypeError: Type is not JSON serializable: flag_value
    ```

### Minimal Reproducible Code

```python
See reproduction steps.
```


### Expected Results

The code works in the same way as the combo of sending & editing with the suppress keyword argument, saving one API call on its way.

### Actual Results

Code crashes.

### Intents

guilds, members, message_content

### System Information

- Python v3.10.6-final
- py-cord v2.2.2-final
- aiohttp v3.8.3
- system info: Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101

(but getting the same error on CI with Linux)

### 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

_No response_


Discussion:

Resolving patch:
diff --git a/discord/abc.py b/discord/abc.py
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -1545,7 +1545,7 @@ async def send(
                     message_reference=reference,
                     stickers=stickers,
                     components=components,
-                    flags=flags,
+                    flags=flags.value,
                 )
             finally:
                 file.close()
@@ -1571,7 +1571,7 @@ async def send(
                     message_reference=reference,
                     stickers=stickers,
                     components=components,
-                    flags=flags,
+                    flags=flags.value,
                 )
             finally:
                 for f in files:
@@ -1588,7 +1588,7 @@ async def send(
                 message_reference=reference,
                 stickers=stickers,
                 components=components,
-                flags=flags,
+                flags=flags.value,
             )
 
         ret = state.create_message(channel=channel, data=data)


Test patch: