Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for relationships #284

Merged
merged 3 commits into from
Nov 9, 2016
Merged

Conversation

VagantemNumen
Copy link
Contributor

Adds Support for:

  • Sending friend request.
  • Accepting friend request.
  • Getting all the relationships.
  • Getting all the mutual friends with another user.
  • Blocking a user.

Note:

Adds Support for:
  - Sending friend request.
  - Accepting friend request.
  - Getting all the relationships.
  - Getting all the mutual friends with another user.
  - Blocking a user.

**Note:**
  - Bot accounts are not allowed to access the endpoint.
  - May close bwmarrin#150
@@ -381,7 +381,7 @@ type Ready struct {
// A Relationship between the logged in user and Relationship.User
type Relationship struct {
User *User `json:"user"`
Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
Type uint8 `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, might as well leave as int.

Changed the uint8 declarations to int.

// relationshipCreate creates a new relationship. (I.e. send or accept a friend request, block a user.)
// relationshipType : 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
func (s *Session) relationshipCreate(userID string, relationshipType uint8) (err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uint8 broke, sorry about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhmm. Forgot to run the tests.

Missed one instance of unint8 during previous push.
@iopred iopred merged commit ed7a451 into bwmarrin:develop Nov 9, 2016
@VagantemNumen VagantemNumen deleted the relationships branch November 9, 2016 01:08
@bwmarrin bwmarrin added this to the v0.15.0 milestone Apr 18, 2017
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
* Add support for relationships

Adds Support for:
  - Sending friend request.
  - Accepting friend request.
  - Getting all the relationships.
  - Getting all the mutual friends with another user.
  - Blocking a user.

**Note:**
  - Bot accounts are not allowed to access the endpoint.
  - May close bwmarrin#150

* Implement requested changes

Changed the uint8 declarations to int.

* Change the missed unint8 declaration to int

Missed one instance of unint8 during previous push.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants