Merge pull request #27 from Slipstreamm/codex/implement-gatewayintent.none-returning-0

Merge PR #27
This commit is contained in:
Slipstream 2025-06-10 17:56:26 -06:00 committed by GitHub
commit 477419bd96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,11 @@ class GatewayIntent(IntEnum):
AUTO_MODERATION_CONFIGURATION = 1 << 20
AUTO_MODERATION_EXECUTION = 1 << 21
@classmethod
def none(cls) -> int:
"""Return a bitmask representing no intents."""
return 0
@classmethod
def default(cls) -> int:
"""Returns default intents (excluding privileged ones like members, presences, message content)."""

View File

@ -16,3 +16,9 @@ bot = Client(
```
These values are passed to `GatewayClient` and applied whenever the connection needs to be re-established.
## Gateway Intents
`GatewayIntent` values control which events your bot receives from the Gateway. Use
`GatewayIntent.none()` to opt out of all events entirely. It returns `0`, which
represents a bitmask with no intents enabled.

View File

@ -0,0 +1,7 @@
import pytest
from disagreement.enums import GatewayIntent
def test_gateway_intent_none_equals_zero():
assert GatewayIntent.none() == 0