Compare commits

...

3 Commits

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