Repository: hikari-py/hikari
Pull request #1333 (2022-10-28 15:36:49)

Fix raise_interrupt test failing on some platforms
### Summary
<!-- Small summary of the merge request -->

### Checklist
<!-- Make sure to tick all the following boxes by putting an `x` in between (like this `[x]`) -->
- [ ] I have run `nox` and all the pipelines have passed.
- [ ] I have made unittests according to the code I have added/modified/deleted.

### Related issues
<!--
To mention an issue use `#issue-id` and to mention a merge request use `!merge-request-id`
To close/fix an issue use `Close #issue-id` or `Fix #issue-id` (depending on the merge request)
-->



Patch:
diff --git a/changes/1320.bugfix.md b/changes/1320.bugfix.md
new file mode 100644
index 00000000..82d5e9fb
--- /dev/null
+++ b/changes/1320.bugfix.md
@@ -0,0 +1,1 @@
+Fix aiohttp error "charset must not be in content type" when using `InteractionServer`
diff --git a/changes/1331.feature.md b/changes/1331.feature.md
new file mode 100644
index 00000000..73811165
--- /dev/null
+++ b/changes/1331.feature.md
@@ -0,0 +1,1 @@
+Support for including the `SUPPRESS_EMBEDS` flag while creating a message.
diff --git a/hikari/api/interaction_server.py b/hikari/api/interaction_server.py
index 56a3e455..9b555654 100644
--- a/hikari/api/interaction_server.py
+++ b/hikari/api/interaction_server.py
@@ -73,6 +73,11 @@ def content_type(self) -> typing.Optional[str]:
         """Content type of the response's payload, if applicable."""
         raise NotImplementedError
 
+    @property
+    def charset(self) -> typing.Optional[str]:
+        """Charset of the response's payload, if applicable."""
+        raise NotImplementedError
+
     @property
     def files(self) -> typing.Sequence[files_.Resource[files_.AsyncReader]]:
         """Up to 10 files that should be included alongside a JSON response."""
diff --git a/hikari/api/rest.py b/hikari/api/rest.py
index a972a2c5..38e1597e 100644
--- a/hikari/api/rest.py
+++ b/hikari/api/rest.py
@@ -1119,6 +1119,7 @@ async def create_message(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, messages_.MessageFlag] = undefined.UNDEFINED,
     ) -> messages_.Message:
         """Create a message in the given channel.
 
@@ -1186,6 +1187,12 @@ async def create_message(
             `hikari.snowflakes.Snowflake`, or
             `hikari.guilds.PartialRole` derivatives to enforce mentioning
             specific roles.
+        flags : hikari.undefined.UndefinedOr[hikari.messages.MessageFlag]
+            If provided, optional flags to set on the message. If
+            `hikari.undefined.UNDEFINED`, then nothing is changed.
+
+            Note that some flags may not be able to be set. Currently the only
+            flags that can be set are `NONE` and `SUPPRESS_EMBEDS`.
 
         !!! note
             Attachments can be passed as many different things, to aid in
@@ -2340,9 +2347,9 @@ async def execute_webhook(
             The flags to set for this webhook message.
 
             !!! warning
-                As of writing this can only be set for interaction webhooks
-                and the only settable flag is EPHEMERAL; this field is just
-                ignored for non-interaction webhooks.
+                As of writing the only flags which can be passed here are
+                `EPHEMERAL` (if this is an interaction response webhook) and
+                `SUPPRESS_EMBEDS`.
 
         !!! warning
             As of writing, `username` and `avatar_url` are ignored for
diff --git a/hikari/channels.py b/hikari/channels.py
index 6ab78b3f..0b23cea6 100644
--- a/hikari/channels.py
+++ b/hikari/channels.py
@@ -524,6 +524,7 @@ async def send(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, messages.MessageFlag] = undefined.UNDEFINED,
     ) -> messages.Message:
         """Create a message in this channel.
 
@@ -586,6 +587,12 @@ async def send(
             `hikari.snowflakes.Snowflake`, or
             `hikari.guilds.PartialRole` derivatives to enforce mentioning
             specific roles.
+        flags : hikari.undefined.UndefinedOr[hikari.messages.MessageFlag]
+            If provided, optional flags to set on the message. If
+            `hikari.undefined.UNDEFINED`, then nothing is changed.
+
+            Note that some flags may not be able to be set. Currently the only
+            flags that can be set are `NONE` and `SUPPRESS_EMBEDS`.
 
         !!! note
             Attachments can be passed as many different things, to aid in
@@ -657,6 +664,7 @@ async def send(
             user_mentions=user_mentions,
             role_mentions=role_mentions,
             mentions_reply=mentions_reply,
+            flags=flags,
         )
 
     def trigger_typing(self) -> special_endpoints.TypingIndicator:
diff --git a/hikari/impl/.gitattributes b/hikari/impl/.gitattributes
new file mode 100644
index 00000000..fcadb2cf
--- /dev/null
+++ b/hikari/impl/.gitattributes
@@ -0,0 +1,1 @@
+* text eol=lf
diff --git a/hikari/impl/interaction_server.py b/hikari/impl/interaction_server.py
index 553d90f2..60d1e6a0 100644
--- a/hikari/impl/interaction_server.py
+++ b/hikari/impl/interaction_server.py
@@ -86,9 +86,7 @@
 _USER_AGENT_KEY: typing.Final[str] = "User-Agent"
 _APPLICATION_OCTET_STREAM: typing.Final[str] = "application/octet-stream"
 _JSON_CONTENT_TYPE: typing.Final[str] = "application/json"
-_JSON_TYPE_WITH_CHARSET: typing.Final[str] = f"{_JSON_CONTENT_TYPE}; charset={_UTF_8_CHARSET}"
 _TEXT_CONTENT_TYPE: typing.Final[str] = "text/plain"
-_TEXT_TYPE_WITH_CHARSET: typing.Final[str] = f"{_TEXT_CONTENT_TYPE}; charset={_UTF_8_CHARSET}"
 
 
 class _Response:
@@ -103,7 +101,7 @@ def __init__(
         files: typing.Sequence[files_.Resource[files_.AsyncReader]] = (),
     ) -> None:
         if payload and not content_type:
-            content_type = _TEXT_TYPE_WITH_CHARSET
+            content_type = _TEXT_CONTENT_TYPE
 
         self._content_type = content_type
         self._files = files
@@ -114,6 +112,11 @@ def __init__(
     def content_type(self) -> typing.Optional[str]:
         return self._content_type
 
+    @property
+    def charset(self) -> typing.Optional[str]:
+        # No cases of charset not being UTF-8
+        return _UTF_8_CHARSET if self._payload else None
+
     @property
     def files(self) -> typing.Sequence[files_.Resource[files_.AsyncReader]]:
         return self._files
@@ -133,7 +136,7 @@ def status_code(self) -> int:
 
 # Constant response
 _PONG_RESPONSE: typing.Final[_Response] = _Response(
-    _OK_STATUS, data_binding.dump_json({"type": _PONG_RESPONSE_TYPE}).encode(), content_type=_JSON_TYPE_WITH_CHARSET
+    _OK_STATUS, data_binding.dump_json({"type": _PONG_RESPONSE_TYPE}).encode(), content_type=_JSON_CONTENT_TYPE
 )
 
 
@@ -345,6 +348,7 @@ async def aiohttp_hook(self, request: aiohttp.web.Request) -> aiohttp.web.Respon
             headers=response.headers,
             body=response.payload,
             content_type=response.content_type,
+            charset=response.charset,
         )
 
     async def close(self) -> None:
@@ -447,7 +451,7 @@ async def on_interaction(self, body: bytes, signature: bytes, timestamp: bytes)
                 )
                 return _Response(_INTERNAL_SERVER_ERROR_STATUS, b"Exception occurred during interaction dispatch")
 
-            return _Response(_OK_STATUS, payload.encode(), files=files, content_type=_JSON_TYPE_WITH_CHARSET)
+            return _Response(_OK_STATUS, payload.encode(), files=files, content_type=_JSON_CONTENT_TYPE)
 
         _LOGGER.debug(
             "Ignoring interaction %s of type %s without registered listener", interaction.id, interaction.type
diff --git a/hikari/impl/rest.py b/hikari/impl/rest.py
index a66eb47e..80f5160e 100644
--- a/hikari/impl/rest.py
+++ b/hikari/impl/rest.py
@@ -1444,6 +1444,7 @@ async def create_message(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, messages_.MessageFlag] = undefined.UNDEFINED,
     ) -> messages_.Message:
         route = routes.POST_CHANNEL_MESSAGES.compile(channel=channel)
         body, form_builder = self._build_message_payload(
@@ -1459,6 +1460,7 @@ async def create_message(
             mentions_reply=mentions_reply,
             user_mentions=user_mentions,
             role_mentions=role_mentions,
+            flags=flags,
         )
         body.put("message_reference", reply, conversion=lambda m: {"message_id": str(int(m))})
 
diff --git a/hikari/messages.py b/hikari/messages.py
index 8ddd1f6f..866a39c1 100644
--- a/hikari/messages.py
+++ b/hikari/messages.py
@@ -1306,6 +1306,7 @@ async def respond(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, MessageFlag] = undefined.UNDEFINED,
     ) -> Message:
         """Create a message in the channel this message belongs to.
 
@@ -1368,6 +1369,12 @@ async def respond(
             `hikari.snowflakes.Snowflake`, or
             `hikari.guilds.PartialRole` derivatives to enforce mentioning
             specific roles.
+        flags : hikari.undefined.UndefinedOr[hikari.messages.MessageFlag]
+            If provided, optional flags to set on the message. If
+            `hikari.undefined.UNDEFINED`, then nothing is changed.
+
+            Note that some flags may not be able to be set. Currently the only
+            flags that can be set are `NONE` and `SUPPRESS_EMBEDS`.
 
         !!! note
             Attachments can be passed as many different things, to aid in
@@ -1445,6 +1452,7 @@ async def respond(
             user_mentions=user_mentions,
             role_mentions=role_mentions,
             mentions_reply=mentions_reply,
+            flags=flags,
         )
 
     async def delete(self) -> None:
diff --git a/hikari/users.py b/hikari/users.py
index eba35705..6b15a39e 100644
--- a/hikari/users.py
+++ b/hikari/users.py
@@ -284,6 +284,7 @@ async def send(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, messages.MessageFlag] = undefined.UNDEFINED,
     ) -> messages.Message:
         """Send a message to this user in DM's.
 
@@ -350,6 +351,12 @@ async def send(
             `hikari.snowflakes.Snowflake`, or
             `hikari.guilds.PartialRole` derivatives to enforce mentioning
             specific roles.
+        flags : hikari.undefined.UndefinedOr[hikari.messages.MessageFlag]
+            If provided, optional flags to set on the message. If
+            `hikari.undefined.UNDEFINED`, then nothing is changed.
+
+            Note that some flags may not be able to be set. Currently the only
+            flags that can be set are `NONE` and `SUPPRESS_EMBEDS`.
 
         !!! note
             Attachments can be passed as many different things, to aid in
@@ -440,6 +447,7 @@ async def send(
             user_mentions=user_mentions,
             role_mentions=role_mentions,
             mentions_reply=mentions_reply,
+            flags=flags,
         )
 
 
@@ -835,5 +843,6 @@ async def send(
         role_mentions: undefined.UndefinedOr[
             typing.Union[snowflakes.SnowflakeishSequence[guilds.PartialRole], bool]
         ] = undefined.UNDEFINED,
+        flags: typing.Union[undefined.UndefinedType, int, messages.MessageFlag] = undefined.UNDEFINED,
     ) -> typing.NoReturn:
         raise TypeError("Unable to send a DM to yourself")
diff --git a/hikari/webhooks.py b/hikari/webhooks.py
index 47d6ab0c..b860abfe 100644
--- a/hikari/webhooks.py
+++ b/hikari/webhooks.py
@@ -200,9 +200,9 @@ async def execute(
             The flags to set for this webhook message.
 
             !!! warning
-                As of writing this can only be set for interaction webhooks
-                and the only settable flag is EPHEMERAL; this field is just
-                ignored for non-interaction webhooks.
+                As of writing the only flags which can be passed here are
+                `EPHEMERAL` (if this is an interaction response webhook) and
+                `SUPPRESS_EMBEDS`.
 
         !!! warning
             As of writing, `username` and `avatar_url` are ignored for


Test patch:
diff --git a/tests/hikari/impl/test_interaction_server.py b/tests/hikari/impl/test_interaction_server.py
index 172cf735..8f995fbf 100644
--- a/tests/hikari/impl/test_interaction_server.py
+++ b/tests/hikari/impl/test_interaction_server.py
@@ -326,7 +326,12 @@ async def test__fetch_public_key_when_public_key_already_set(
     async def test_aiohttp_hook(self, mock_interaction_server: interaction_server_impl.InteractionServer):
         mock_interaction_server.on_interaction = mock.AsyncMock(
             return_value=mock.Mock(
-                payload=b"abody", files=[], status_code=200, headers={"header1": "ok"}, content_type="ooga/booga"
+                payload=b"abody",
+                files=[],
+                status_code=200,
+                headers={"header1": "ok"},
+                content_type="ooga/booga",
+                charset=None,
             )
         )
         request = mock.Mock(
@@ -351,7 +356,9 @@ async def test_aiohttp_hook_when_no_other_headers(
         self, mock_interaction_server: interaction_server_impl.InteractionServer
     ):
         mock_interaction_server.on_interaction = mock.AsyncMock(
-            return_value=mock.Mock(payload=b"abody", files=[], headers=None, status_code=200, content_type="ooga/booga")
+            return_value=mock.Mock(
+                payload=b"abody", files=[], headers=None, status_code=200, content_type="ooga/booga", charset=None
+            )
         )
         request = mock.Mock(
             aiohttp.web.Request,
@@ -582,7 +589,8 @@ async def test_on_interaction(
         mock_listener.assert_awaited_once_with(mock_entity_factory.deserialize_interaction.return_value)
         mock_builder.build.assert_called_once_with(mock_entity_factory)
         mock_entity_factory.deserialize_interaction.assert_called_once_with(valid_payload)
-        assert result.content_type == "application/json; charset=UTF-8"
+        assert result.content_type == "application/json"
+        assert result.charset == "UTF-8"
         assert result.files == [mock_file_1, mock_file_2]
         assert result.headers is None
         assert result.payload == b'{"ok": "No boomer"}'
@@ -602,7 +610,8 @@ async def test_on_interaction_calls__fetch_public_key(
 
         mock_fetcher.assert_awaited_once()
         mock_fetcher.return_value.verify.assert_called_once_with(b"timestampbody", b"signature")
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Invalid request signature"
@@ -619,7 +628,8 @@ async def test_on_interaction_when_public_key_mismatch(
 
         result = await mock_interaction_server.on_interaction(*invalid_ed25519)
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Invalid request signature"
@@ -634,7 +644,8 @@ async def test_on_interaction_when_bad_body(
 
         result = await mock_interaction_server.on_interaction(body, b"signature", b"timestamp")
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Invalid JSON body"
@@ -648,7 +659,8 @@ async def test_on_interaction_when_missing_type_key(
 
         result = await mock_interaction_server.on_interaction(b'{"key": "OK"}', b"signature", b"timestamp")
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Missing required 'type' field in payload"
@@ -660,7 +672,8 @@ async def test_on_interaction_on_ping(self, mock_interaction_server: interaction
 
         result = await mock_interaction_server.on_interaction(b'{"type": 1}', b"signature", b"timestamp")
 
-        assert result.content_type == "application/json; charset=UTF-8"
+        assert result.content_type == "application/json"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b'{"type": 1}'
@@ -677,7 +690,8 @@ async def test_on_interaction_on_deserialize_unrecognised_entity_error(
 
         result = await mock_interaction_server.on_interaction(b'{"type": 2}', b"signature", b"timestamp")
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Interaction type not implemented"
@@ -700,7 +714,8 @@ async def test_on_interaction_on_failed_deserialize(
                 {"message": "Exception occurred during interaction deserialization", "exception": mock_exception}
             )
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Exception occurred during interaction deserialization"
@@ -728,7 +743,8 @@ async def test_on_interaction_on_dispatch_error(
                 {"message": "Exception occurred during interaction dispatch", "exception": mock_exception}
             )
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Exception occurred during interaction dispatch"
@@ -757,7 +773,8 @@ async def test_on_interaction_when_response_builder_error(
                 {"message": "Exception occurred during interaction dispatch", "exception": mock_exception}
             )
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Exception occurred during interaction dispatch"
@@ -787,7 +804,8 @@ async def test_on_interaction_when_json_encode_fails(
                 {"message": "Exception occurred during interaction dispatch", "exception": mock_exception}
             )
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Exception occurred during interaction dispatch"
@@ -803,7 +821,8 @@ async def test_on_interaction_when_no_registered_listener(
 
         result = await mock_interaction_server.on_interaction(b'{"type": 2}', b"signature", b"timestamp")
 
-        assert result.content_type == "text/plain; charset=UTF-8"
+        assert result.content_type == "text/plain"
+        assert result.charset == "UTF-8"
         assert result.files == ()
         assert result.headers is None
         assert result.payload == b"Handler not set for this interaction type"
diff --git a/tests/hikari/impl/test_rest.py b/tests/hikari/impl/test_rest.py
index 581e422a..ea94ca0f 100644
--- a/tests/hikari/impl/test_rest.py
+++ b/tests/hikari/impl/test_rest.py
@@ -2510,6 +2510,7 @@ async def test_create_message_when_form(self, rest_client):
             user_mentions=[9876],
             role_mentions=[1234],
             reply=StubModel(987654321),
+            flags=54123,
         )
         assert returned is rest_client._entity_factory.deserialize_message.return_value
 
@@ -2526,6 +2527,7 @@ async def test_create_message_when_form(self, rest_client):
             mentions_reply=undefined.UNDEFINED,
             user_mentions=[9876],
             role_mentions=[1234],
+            flags=54123,
         )
         mock_form.add_field.assert_called_once_with(
             "payload_json",
@@ -2562,6 +2564,7 @@ async def test_create_message_when_no_form(self, rest_client):
             user_mentions=[9876],
             role_mentions=[1234],
             reply=StubModel(987654321),
+            flags=6643,
         )
         assert returned is rest_client._entity_factory.deserialize_message.return_value
 
@@ -2578,6 +2581,7 @@ async def test_create_message_when_no_form(self, rest_client):
             mentions_reply=undefined.UNDEFINED,
             user_mentions=[9876],
             role_mentions=[1234],
+            flags=6643,
         )
         rest_client._request.assert_awaited_once_with(
             expected_route,
diff --git a/tests/hikari/internal/test_signals.py b/tests/hikari/internal/test_signals.py
index 2688d4fa..7724fea2 100644
--- a/tests/hikari/internal/test_signals.py
+++ b/tests/hikari/internal/test_signals.py
@@ -30,8 +30,9 @@
 
 
 def test__raise_interrupt():
-    with pytest.raises(errors.HikariInterrupt):
-        signals._raise_interrupt(1)
+    with mock.patch.object(signal, "strsignal"):  # signals are not always implemented
+        with pytest.raises(errors.HikariInterrupt):
+            signals._raise_interrupt(1)
 
 
 @pytest.mark.parametrize("trace", [True, False])
diff --git a/tests/hikari/test_channels.py b/tests/hikari/test_channels.py
index 5fded6e3..336d9c65 100644
--- a/tests/hikari/test_channels.py
+++ b/tests/hikari/test_channels.py
@@ -286,6 +286,7 @@ async def test_send(self, model):
             user_mentions=[123, 456],
             role_mentions=[789, 567],
             mentions_reply=True,
+            flags=6969,
         )
 
         model.app.rest.create_message.assert_awaited_once_with(
@@ -303,6 +304,7 @@ async def test_send(self, model):
             user_mentions=[123, 456],
             role_mentions=[789, 567],
             mentions_reply=True,
+            flags=6969,
         )
 
     def test_trigger_typing(self, model):
diff --git a/tests/hikari/test_messages.py b/tests/hikari/test_messages.py
index 5738a8f5..e8c5bb4e 100644
--- a/tests/hikari/test_messages.py
+++ b/tests/hikari/test_messages.py
@@ -239,6 +239,7 @@ async def test_respond(self, message):
             user_mentions=False,
             role_mentions=roles,
             mentions_reply=True,
+            flags=321123,
         )
         message.app.rest.create_message.assert_awaited_once_with(
             channel=456,
@@ -255,6 +256,7 @@ async def test_respond(self, message):
             user_mentions=False,
             role_mentions=roles,
             mentions_reply=True,
+            flags=321123,
         )
 
     async def test_respond_when_reply_is_True(self, message):
@@ -277,6 +279,7 @@ async def test_respond_when_reply_is_True(self, message):
             user_mentions=undefined.UNDEFINED,
             role_mentions=undefined.UNDEFINED,
             mentions_reply=undefined.UNDEFINED,
+            flags=undefined.UNDEFINED,
         )
 
     async def test_respond_when_reply_is_False(self, message):
@@ -299,6 +302,7 @@ async def test_respond_when_reply_is_False(self, message):
             user_mentions=undefined.UNDEFINED,
             role_mentions=undefined.UNDEFINED,
             mentions_reply=undefined.UNDEFINED,
+            flags=undefined.UNDEFINED,
         )
 
     async def test_delete(self, message):
diff --git a/tests/hikari/test_users.py b/tests/hikari/test_users.py
index 476ecba1..1103fe5e 100644
--- a/tests/hikari/test_users.py
+++ b/tests/hikari/test_users.py
@@ -81,6 +81,7 @@ async def test_send_uses_cached_id(self, obj):
             user_mentions=user_mentions,
             role_mentions=role_mentions,
             mentions_reply=mentions_reply,
+            flags=34123342,
         )
 
         assert returned is obj.app.rest.create_message.return_value
@@ -102,6 +103,7 @@ async def test_send_uses_cached_id(self, obj):
             user_mentions=user_mentions,
             role_mentions=role_mentions,
             mentions_reply=mentions_reply,
+            flags=34123342,
         )
 
     @pytest.mark.asyncio()
@@ -132,6 +134,7 @@ async def test_send_when_not_cached(self, obj):
             user_mentions=undefined.UNDEFINED,
             role_mentions=undefined.UNDEFINED,
             mentions_reply=undefined.UNDEFINED,
+            flags=undefined.UNDEFINED,
         )
 
     @pytest.mark.asyncio()
@@ -160,6 +163,7 @@ async def test_send_when_not_cache_aware(self, obj):
             user_mentions=undefined.UNDEFINED,
             role_mentions=undefined.UNDEFINED,
             mentions_reply=undefined.UNDEFINED,
+            flags=undefined.UNDEFINED,
         )
 
     @pytest.mark.asyncio()