Skip to content

Commit

Permalink
Cleaned up GATEWAY.md (discord#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
David authored and b1naryth1ef committed Apr 11, 2016
1 parent 682624e commit facad9d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
3 changes: 0 additions & 3 deletions docs/resources/USER.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ Modify the requestors user account settings.
| Field | Type | Description |
|-------|------|-------------|
| username | string | users username, if changed will randomize the users discriminator |
| email | string | users email, if changed will unverify a verified user |
| password | string | users current password |
| new_password | string | if passed, will change the users password to this value |
| avatar | [avatar data](#DOCS_USER/avatar-data) | if passed, modifies the users avatar |

## Get Current User Guilds % GET /users/{@me#DOCS_USER/user-object}/guilds
Expand Down
52 changes: 47 additions & 5 deletions docs/topics/GATEWAY.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Used to maintain an active gateway connection. Must be sent every `heartbeat_int

Used to trigger the initial handshake with the gateway.

####### Gateway Identify Structure
###### Gateway Identify Structure

| Field | Type | Description |
|-------|------|-------------|
Expand Down Expand Up @@ -245,6 +245,10 @@ Packets sent from the client to the Gateway API are encapsulated within a [gatew

Receiving payloads with the Gateway API is slightly more complex than sending. When using the JSON encoding with compression enabled, the Gateway has the option of sending payloads as compressed JSON binaries using zlib, meaning your library _must_ detect and decompress these payloads before attempting to parse them. The gateway does not implement a shared compression context between messages sent.

### Event Names

Event names are in standard constant form, fully upper-cased and replacing all spaces with underscores. For instance, [Channel Create](#DOCS_GATEWAY/channel-create) would be `CHANNEL_CREATE` and [Voice State Update](#DOCS_GATEWAY/voice-state-update) would be `VOICE_STATE_UPDATE`.

## Events

### Ready
Expand Down Expand Up @@ -289,20 +293,29 @@ This event can be sent in three different scenarios:
2. When a Guild becomes available again to the client.
3. When the current user joins a new Guild.

The inner payload is a [guild](#DOCS_GUILD/guild-object) object.
The inner payload is a [guild](#DOCS_GUILD/guild-object) object.

### Guild Update

Sent when a guild is updated. The inner payload is a [guild](#DOCS_GUILD/guild-object) object.

### Guild Emoji Update

Sent when a guilds emojis have been updated. The inner payload is a `guild_id` snowflake, and a `emojis` key which is an array of [emoji](#DOCS_GUILD/emoji-object) objects.
Sent when a guilds emojis have been updated.

###### Guild Emoji Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | id of the guild |
| emojis | array | array of [emojis](#DOCS_GUILD/emoji-object) |

### Guild Delete

Sent when a guild becomes unavailable during a guild outage, or when the user leaves or is removed from a guild. See GUILD_CREATE for more information about how to handle this event.

###### Guild Delete Event Fields

| Field | Type | Description |
|-------|------|-------------|
| id | snowflake | id of the guild |
Expand All @@ -312,18 +325,28 @@ Sent when a guild becomes unavailable during a guild outage, or when the user le

Sent when a guild integration is updated.

###### Guild Integrations Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | id of the guild whose integrations where updated |

### Guild Member Add

Sent when a new user joins a guild. The inner payload is a [guild member](#DOCS_GUILD/guild-member-object) object, with an extra `guild_id` key.
Sent when a new user joins a guild. The inner payload is a [guild member](#DOCS_GUILD/guild-member-object) object with these extra fields:

###### Guild Member Add Extra Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | id of the guild |

### Guild Member Remove

Sent when a user is removed from a guild (leave/kick/ban).

###### Guild Member Remove Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | the id of the guild |
Expand All @@ -333,6 +356,8 @@ Sent when a user is removed from a guild (leave/kick/ban).

Sent when a guild member is updated.

###### Guild Member Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | the id of the guild |
Expand All @@ -343,6 +368,8 @@ Sent when a guild member is updated.

Sent when a guild role is created.

###### Guild Role Create Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | the id of the guild |
Expand All @@ -352,6 +379,8 @@ Sent when a guild role is created.

Sent when a guild role is updated.

###### Guild Role Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | the id of the guild |
Expand All @@ -361,6 +390,8 @@ Sent when a guild role is updated.

Sent when a guild role is deleted

###### Guild Role Delete Event Fields

| Field | Type | Description |
|-------|------|-------------|
| guild_id | snowflake | id of the guild |
Expand All @@ -372,12 +403,17 @@ Sent when a message is created. The inner payload is a [message](#DOCS_CHANNEL/m

### Message Update

Sent when a message is updated. The inner payload is a [message](#DOCS_CHANNEL/message-object) object. Unlike creates, message updates may contain only a subset of the full message object payload (but will always contain an id and channel_id).
Sent when a message is updated. The inner payload is a [message](#DOCS_CHANNEL/message-object) object.

>warn
> Unlike creates, message updates may contain only a subset of the full message object payload (but will always contain an id and channel_id).
### Message Delete

Sent when a message is deleted.

###### Message Delete Event Fields

| Field | Type | Description |
|-------|------|-------------|
| id | snowflake | the id of the message |
Expand All @@ -387,6 +423,8 @@ Sent when a message is deleted.

Sent when a users presence is updated.

###### Presence Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| user | [user](#DOCS_USER/user-object) object | the user presence is being updated for |
Expand All @@ -399,6 +437,8 @@ Sent when a users presence is updated.

Sent when a user starts typing in a channel.

###### Typing Start Event Fields

| Field | Type | Description |
|-------|------|-------------|
| channel_id | snowflake | id of the channel |
Expand All @@ -417,6 +457,8 @@ Sent when properties about the user change. Inner payload is a [user](#DOCS_USER

Sent when someone joins/leaves/moves voice channels.

###### Voice State Update Event Fields

| Field | Type | Description |
|-------|------|-------------|
| user_id | snowflake | id of the user |
Expand Down

0 comments on commit facad9d

Please sign in to comment.