docs: add license info and reformat (#1)

This commit is contained in:
Slipstream 2025-06-09 23:01:59 -06:00 committed by GitHub
parent d1475a7101
commit b5bef75199
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 13 deletions

View File

@ -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. 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.

View File

@ -166,6 +166,7 @@ class GatewayClient:
print( print(
f"Sent RESUME for session {self._session_id} at sequence {self._last_sequence}." f"Sent RESUME for session {self._session_id} at sequence {self._last_sequence}."
) )
async def update_presence( async def update_presence(
self, self,
status: str, status: str,
@ -179,14 +180,16 @@ class GatewayClient:
"op": GatewayOpcode.PRESENCE_UPDATE, "op": GatewayOpcode.PRESENCE_UPDATE,
"d": { "d": {
"since": since, "since": since,
"activities": [ "activities": (
[
{ {
"name": activity_name, "name": activity_name,
"type": activity_type, "type": activity_type,
} }
] ]
if activity_name if activity_name
else [], else []
),
"status": status, "status": status,
"afk": afk, "afk": afk,
}, },

View File

@ -55,13 +55,9 @@ intents = GatewayIntent.default() | GatewayIntent.MESSAGE_CONTENT
# Create a new client # Create a new client
client = Client( client = Client(
token=token, token=token,
intents=intents, intents=intents,
command_prefix="!", command_prefix="!",
mention_replies=True, mention_replies=True,
) )

View File

@ -36,6 +36,8 @@ class DummyBot:
async def fetch_channel(self, cid): async def fetch_channel(self, cid):
return self._channels.get(cid) return self._channels.get(cid)
from disagreement.ext.commands.core import CommandContext, Command from disagreement.ext.commands.core import CommandContext, Command
from disagreement.enums import MessageFlags, ButtonStyle, ComponentType from disagreement.enums import MessageFlags, ButtonStyle, ComponentType
from disagreement.models import ActionRow, Button, Container, TextDisplay from disagreement.models import ActionRow, Button, Container, TextDisplay

View File

@ -26,6 +26,7 @@ class DummyClient:
self.loop = asyncio.get_event_loop() 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 @pytest.mark.asyncio
async def test_client_connect_backoff(monkeypatch): async def test_client_connect_backoff(monkeypatch):
http = DummyHTTP() http = DummyHTTP()

View File

@ -7,6 +7,7 @@ from disagreement.errors import DisagreementException
from unittest.mock import MagicMock from unittest.mock import MagicMock
class DummyGateway(MagicMock): class DummyGateway(MagicMock):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)