Browse Source

Add APIClient.users_me_get and APIClient.users_me_patch

Not currently hooked up, but useful nonetheless
feature/docs
Andrei 8 years ago
parent
commit
8216ec4ad7
  1. 8
      disco/api/client.py

8
disco/api/client.py

@ -222,7 +222,6 @@ class APIClient(LoggingClass):
# TODO: better error here? # TODO: better error here?
raise Exception('Invalid channel type: {}'.format(channel_type)) raise Exception('Invalid channel type: {}'.format(channel_type))
r = self.http(Routes.GUILDS_CHANNELS_CREATE, dict(guild=guild), json=payload) r = self.http(Routes.GUILDS_CHANNELS_CREATE, dict(guild=guild), json=payload)
return Channel.create(self.client, r.json(), guild_id=guild) return Channel.create(self.client, r.json(), guild_id=guild)
@ -305,6 +304,13 @@ class APIClient(LoggingClass):
def guilds_emojis_delete(self, guild, emoji): def guilds_emojis_delete(self, guild, emoji):
self.http(Routes.GUILDS_EMOJIS_DELETE, dict(guild=guild, emoji=emoji)) self.http(Routes.GUILDS_EMOJIS_DELETE, dict(guild=guild, emoji=emoji))
def users_me_get(self):
return User.create(self.client, self.http(Routes.USERS_ME_GET).json())
def users_me_patch(self, payload):
r = self.http(Routes.USERS_ME_PATCH, json=payload)
return User.create(self.client, r.json())
def invites_get(self, invite): def invites_get(self, invite):
r = self.http(Routes.INVITES_GET, dict(invite=invite)) r = self.http(Routes.INVITES_GET, dict(invite=invite))
return Invite.create(self.client, r.json()) return Invite.create(self.client, r.json())

Loading…
Cancel
Save