Skip to content

Commit

Permalink
📝 Add exceptions to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Jan 7, 2025
1 parent 4829614 commit ed944d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,8 @@ def intents(self, value: Any) -> None: # pyright: ignore [reportExplicitAny]
------
TypeError
The value is not an instance of Intents.
R
AttributeError
The intents cannot be changed after the connection is established.
"""
if not isinstance(value, Intents):
raise TypeError(
Expand Down
2 changes: 2 additions & 0 deletions discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ def intents(self, value: Any) -> None: # pyright: ignore [reportExplicitAny]
------
TypeError
The value passed is not of type :class:`Intents`.
AttributeError
The intents cannot be changed after the connection is established.
"""
if not isinstance(value, Intents):
raise TypeError(f"Intents must be of type Intents not {value.__class__!r}")
Expand Down

0 comments on commit ed944d1

Please sign in to comment.