Browse Source

Add Guild.get_invites, Guild.get_emojis, MessageReactionAdd.delete

pull/27/head
Andrei 8 years ago
parent
commit
8687a47c14
  1. 4
      disco/api/client.py
  2. 8
      disco/gateway/events.py
  3. 6
      disco/types/guild.py

4
disco/api/client.py

@ -314,6 +314,10 @@ class APIClient(LoggingClass):
def guilds_roles_delete(self, guild, role):
self.http(Routes.GUILDS_ROLES_DELETE, dict(guild=guild, role=role))
def guilds_invites_list(self, guild):
r = self.http(Routes.GUILDS_INVITES_LIST, dict(guild=guild))
return Invite.create_map(self.client, r.json())
def guilds_webhooks_list(self, guild):
r = self.http(Routes.GUILDS_WEBHOOKS_LIST, dict(guild=guild))
return Webhook.create_map(self.client, r.json())

8
disco/gateway/events.py

@ -610,6 +610,14 @@ class MessageReactionAdd(GatewayEvent):
user_id = Field(snowflake)
emoji = Field(MessageReactionEmoji)
def delete(self):
self.client.api.channels_messages_reactions_delete(
self.channel_id,
self.message_id,
self.emoji,
self.uesr_id
)
@property
def channel(self):
return self.client.state.channels.get(self.channel_id)

6
disco/types/guild.py

@ -442,3 +442,9 @@ class Guild(SlottedModel, Permissible):
def leave(self):
return self.client.api.users_me_guilds_delete(self.id)
def get_invites(self):
return self.client.api.guilds_invites_list(self.id)
def get_emojis(self):
return self.client.api.guilds_emojis_list(self.id)

Loading…
Cancel
Save