Skip to content

Instantly share code, notes, and snippets.

@DV8FromTheWorld
Created October 8, 2016 19:24
Show Gist options
  • Save DV8FromTheWorld/3219fc062e9c9ddb9837e547f8461f16 to your computer and use it in GitHub Desktop.
Save DV8FromTheWorld/3219fc062e9c9ddb9837e547f8461f16 to your computer and use it in GitHub Desktop.
Documentation of Discord's client-only relationship system
type:
0 - no relationship
1 - friend
2 - blocked
3 - incoming friend request
4 - outgoing friend request
accepting FR triggers RELATIONSHIP_ADD 1
remove friend triggers RELATIONSHIP_REMOVE 1
block triggers RELATIONSHIP_ADD 2
block does not cause RELATIONSHIP_REMOVE to be fired for other types before overriding
unblock triggers RELATIONSHIP_REMOVE 2
unblock triggers RELATIONSHIP_REMOVE 0 for unblocked user
recieve FR triggers RELATIONSHIP_ADD 3
deny received FR triggers RELATIONSHIP_REMOVE 3
deny received FR triggers nothing for user who FR was received from
- blocking a user while a received FR is active will cause the block process above to take place
but also the user that sent the FR that was blocked will received RELATIONSHIP_REMOVE 4
Normal deny does not do this. The Relationship remains for the sending user
send FR triggers RELATIONSHIP_ADD 4
- if blocked by receiving user, no event is triggered.
cancel sent FR triggers RELATIONSHIP_REMOVE 4
remove friend /users/@me/relationships/:user_id DELETE : 204
block /users/@me/relationships/:user_id PUT {type: 2} : 204
unblock /users/@me/relationships/:user_id DELETE : 204
send FR /users/@me/relationships/:user_id PUT {} : 204
- no indication if the FR was received (blocked vs non-blocked by receiving user)
cancel FR /users/@me/relationships/:user_id DELETE : 204
accept FR /users/@me/relationships/:user_id PUT {} : 204
ignore FR /users/@me/relationships/:user_id DELETE : 204
things left to test
- what happens when blocking / sending FR to non-guild connected users
- when we get unblocked, do we still get RELATIONSHIP_REMOVE 0 when we dont share a guild with the user that unblocked us
- what happens if we attempt to send a FR to a user we blocked (can't do in client, need to test with RESt directly)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment