docs: add license info and reformat (#1)
This commit is contained in:
parent
d1475a7101
commit
b5bef75199
@ -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.
|
||||||
|
|
||||||
|
@ -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,
|
{
|
||||||
"type": activity_type,
|
"name": activity_name,
|
||||||
}
|
"type": activity_type,
|
||||||
]
|
}
|
||||||
if activity_name
|
]
|
||||||
else [],
|
if activity_name
|
||||||
|
else []
|
||||||
|
),
|
||||||
"status": status,
|
"status": status,
|
||||||
"afk": afk,
|
"afk": afk,
|
||||||
},
|
},
|
||||||
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -24,7 +24,8 @@ class DummyDispatcher:
|
|||||||
class DummyClient:
|
class DummyClient:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
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):
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user