aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorSteven Berler <[email protected]>2016-01-07 23:29:56 -0800
committerRapptz <[email protected]>2016-01-08 13:24:56 -0500
commit777b5a09e2e2f6b2948373d610f59d504bf61067 (patch)
treee6e2bc4c4bdcefe96a615a47808b7bc3c8a97dba /discord/client.py
parentperformance improvements (diff)
downloaddiscord.py-777b5a09e2e2f6b2948373d610f59d504bf61067.tar.xz
discord.py-777b5a09e2e2f6b2948373d610f59d504bf61067.zip
document public get_ methods and make others private
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/discord/client.py b/discord/client.py
index 2e339e60..5c979128 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -213,7 +213,7 @@ class Client:
if isinstance(destination, (Channel, PrivateChannel, Server)):
return destination.id
elif isinstance(destination, User):
- found = self.connection.get_private_channel_by_user(destination.id)
+ found = self.connection._get_private_channel_by_user(destination.id)
if found is None:
# Couldn't find the user, so start a PM with them first.
channel = yield from self.start_private_message(destination)
@@ -429,6 +429,10 @@ class Client:
"""Returns a :class:`Channel` or :class:`PrivateChannel` with the following ID. If not found, returns None."""
return self.connection.get_channel(id)
+ def get_server(self, id):
+ """Returns a :class:`Server` with the given ID. If not found, returns None."""
+ return self.connection._get_server(id)
+
def get_all_channels(self):
"""A generator that retrieves every :class:`Channel` the client can 'access'.
@@ -853,7 +857,7 @@ class Client:
data = yield from r.json()
log.debug(request_success_log.format(response=r, json=payload, data=data))
channel = PrivateChannel(id=data['id'], user=user)
- self.connection.add_private_channel(channel)
+ self.connection._add_private_channel(channel)
return channel
@asyncio.coroutine
@@ -1746,7 +1750,7 @@ class Client:
# Invite management
def _fill_invite_data(self, data):
- server = self.connection.get_server(data['guild']['id'])
+ server = self.connection._get_server(data['guild']['id'])
if server is not None:
ch_id = data['channel']['id']
channel = server.get_channel(ch_id)