|
@@ -1736,3 +1736,71 @@ func (s *Session) MessageReactions(channelID, messageID, emojiID string, limit i
|
|
|
err = unmarshal(body, &st)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipsGet() (r []*Relationship, err error) {
|
|
|
+ body, err := s.RequestWithBucketID("GET", EndpointRelationships(), nil, EndpointRelationships())
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ err = unmarshal(body, &r)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) relationshipCreate(userID string, relationshipType int) (err error) {
|
|
|
+ data := struct {
|
|
|
+ Type int `json:"type"`
|
|
|
+ }{relationshipType}
|
|
|
+
|
|
|
+ fmt.Println("Data: " + fmt.Sprintf("%v", data))
|
|
|
+
|
|
|
+ _, err = s.RequestWithBucketID("PUT", EndpointRelationship(userID), data, EndpointRelationships())
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipFriendRequestSend(userID string) (err error) {
|
|
|
+ err = s.relationshipCreate(userID, 4)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipFriendRequestAccept(userID string) (err error) {
|
|
|
+ err = s.relationshipCreate(userID, 1)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipUserBlock(userID string) (err error) {
|
|
|
+ err = s.relationshipCreate(userID, 2)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipDelete(userID string) (err error) {
|
|
|
+ _, err = s.RequestWithBucketID("DELETE", EndpointRelationship(userID), nil, EndpointRelationships())
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) RelationshipsMutualGet(userID string) (mf []*User, err error) {
|
|
|
+ body, err := s.RequestWithBucketID("GET", EndpointRelationshipsMutual(userID), nil, EndpointRelationshipsMutual(userID))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ err = unmarshal(body, &mf)
|
|
|
+ return
|
|
|
+}
|