Compare commits
3 Commits
eb8d7a9656
...
477419bd96
Author | SHA1 | Date | |
---|---|---|---|
477419bd96 | |||
c27a25955a | |||
8b0e6fcce2 |
@ -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)."""
|
||||
|
@ -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.
|
||||
|
7
tests/test_gateway_intent.py
Normal file
7
tests/test_gateway_intent.py
Normal file
@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from disagreement.enums import GatewayIntent
|
||||
|
||||
|
||||
def test_gateway_intent_none_equals_zero():
|
||||
assert GatewayIntent.none() == 0
|
Loading…
x
Reference in New Issue
Block a user