diff --git a/README.md b/README.md index 49daefb..fa3e7f9 100644 --- a/README.md +++ b/README.md @@ -129,3 +129,7 @@ Contributions are welcome! Please open an issue or submit a pull request. See the [docs](docs/) directory for detailed guides on components, slash commands, caching, and voice features. +## License + +This project is licensed under the BSD 3-Clause license. See the [LICENSE](LICENSE) file for details. + diff --git a/disagreement/gateway.py b/disagreement/gateway.py index 91f0539..cdb07b6 100644 --- a/disagreement/gateway.py +++ b/disagreement/gateway.py @@ -166,6 +166,7 @@ class GatewayClient: print( f"Sent RESUME for session {self._session_id} at sequence {self._last_sequence}." ) + async def update_presence( self, status: str, @@ -179,14 +180,16 @@ class GatewayClient: "op": GatewayOpcode.PRESENCE_UPDATE, "d": { "since": since, - "activities": [ - { - "name": activity_name, - "type": activity_type, - } - ] - if activity_name - else [], + "activities": ( + [ + { + "name": activity_name, + "type": activity_type, + } + ] + if activity_name + else [] + ), "status": status, "afk": afk, }, diff --git a/examples/component_bot.py b/examples/component_bot.py index eae1e67..60a8405 100644 --- a/examples/component_bot.py +++ b/examples/component_bot.py @@ -55,13 +55,9 @@ intents = GatewayIntent.default() | GatewayIntent.MESSAGE_CONTENT # Create a new client client = Client( - token=token, - intents=intents, - command_prefix="!", - mention_replies=True, ) diff --git a/tests/test_context.py b/tests/test_context.py index 463a00a..8e22216 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -36,6 +36,8 @@ class DummyBot: async def fetch_channel(self, cid): return self._channels.get(cid) + + from disagreement.ext.commands.core import CommandContext, Command from disagreement.enums import MessageFlags, ButtonStyle, ComponentType from disagreement.models import ActionRow, Button, Container, TextDisplay diff --git a/tests/test_gateway_backoff.py b/tests/test_gateway_backoff.py index c5dbb21..d517f20 100644 --- a/tests/test_gateway_backoff.py +++ b/tests/test_gateway_backoff.py @@ -24,7 +24,8 @@ class DummyDispatcher: class DummyClient: def __init__(self): self.loop = asyncio.get_event_loop() - self.application_id = None # Mock application_id for Client.connect + self.application_id = None # Mock application_id for Client.connect + @pytest.mark.asyncio async def test_client_connect_backoff(monkeypatch): diff --git a/tests/test_presence_update.py b/tests/test_presence_update.py index cf43818..3135cf7 100644 --- a/tests/test_presence_update.py +++ b/tests/test_presence_update.py @@ -7,6 +7,7 @@ from disagreement.errors import DisagreementException from unittest.mock import MagicMock + class DummyGateway(MagicMock): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)