Skip to content

Commit

Permalink
Add missing shard error documentation (#2100)
Browse files Browse the repository at this point in the history
Signed-off-by: Blaze <[email protected]>
Co-authored-by: davfsa <[email protected]>
  • Loading branch information
syncblaze and davfsa authored Nov 12, 2024
1 parent 4c25d98 commit cca2c51
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/2100.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added missing documentation for `GatewayShard` and for trait `ShardAware`, adding missing errors which can be thrown.
17 changes: 17 additions & 0 deletions hikari/api/shard.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def get_user_id(self) -> snowflakes.Snowflake:
-------
hikari.snowflakes.Snowflake
The user ID for the application user.
Raises
------
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -158,6 +163,11 @@ async def update_presence(
changed.
status
The web status to show. If undefined, this will not be changed.
Raises
------
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -185,6 +195,11 @@ async def update_voice_state(
self_deaf
If specified and [`True`][], the bot will deafen itself in that
voice channel. If [`False`][], then it will undeafen itself.
Raises
------
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -227,4 +242,6 @@ async def request_guild_members(
hikari.errors.MissingIntentError
When trying to request presences without the [`hikari.intents.Intents.GUILD_MEMBERS`][] or when trying to
request the full list of members without [`hikari.intents.Intents.GUILD_PRESENCES`][].
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""
9 changes: 9 additions & 0 deletions hikari/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ async def update_presence(
changed.
status
The web status to show. If undefined, this will not be changed.
Raises
------
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""
raise NotImplementedError

Expand Down Expand Up @@ -349,6 +354,8 @@ async def update_voice_state(
RuntimeError
If the guild passed isn't covered by any of the shards in this sharded
client.
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -394,6 +401,8 @@ async def request_guild_members(
RuntimeError
If the guild passed isn't covered by any of the shards in this sharded
client.
hikari.errors.ComponentStateConflictError
When the shard is not connected so it cannot be interacted with.
"""


Expand Down

0 comments on commit cca2c51

Please sign in to comment.