Skip to content

Commit befd468

Browse files
authored
feat: bot.guilds (#634)
1 parent a341617 commit befd468

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

interactions/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def __init__(
9898
data = self._loop.run_until_complete(self._http.get_current_bot_information())
9999
self.me = Application(**data)
100100

101+
@property
102+
def guilds(self) -> List[Guild]:
103+
"""Returns a list of guilds the bot is in."""
104+
return [Guild(**_, _client=self._http) for _ in self._http.cache.self_guilds.view]
105+
101106
@property
102107
def latency(self) -> float:
103108
"""Returns the connection latency in milliseconds."""

interactions/client.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Client:
3535
**kwargs,
3636
) -> None: ...
3737
@property
38+
def guilds(self) -> List[Guild]: ...
39+
@property
3840
def latency(self) -> float: ...
3941
def start(self) -> None: ...
4042
def __register_events(self) -> None: ...

0 commit comments

Comments
 (0)