|
@@ -1228,6 +1228,28 @@ func (s *Session) ChannelMessageSendTTS(channelID string, content string) (st *M
|
|
|
return s.channelMessageSend(channelID, content, true)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (s *Session) ChannelMessageSendEmbed(channelID string, embed *MessageEmbed) (st *Message, err error) {
|
|
|
+ if embed != nil && embed.Type == "" {
|
|
|
+ embed.Type = "rich"
|
|
|
+ }
|
|
|
+
|
|
|
+ data := struct {
|
|
|
+ Embed *MessageEmbed `json:"embed"`
|
|
|
+ }{embed}
|
|
|
+
|
|
|
+
|
|
|
+ response, err := s.RequestWithBucketID("POST", EndpointChannelMessages(channelID), data, EndpointChannelMessages(channelID))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ err = unmarshal(response, &st)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1680,8 +1702,6 @@ func (s *Session) WebhookExecute(webhookID, token string, wait bool, data *Webho
|
|
|
uri += "?wait=true"
|
|
|
}
|
|
|
|
|
|
- fmt.Println(uri)
|
|
|
-
|
|
|
_, err = s.RequestWithBucketID("POST", uri, data, EndpointWebhookToken("", ""))
|
|
|
|
|
|
return
|
|
@@ -1759,8 +1779,6 @@ func (s *Session) relationshipCreate(userID string, relationshipType int) (err e
|
|
|
Type int `json:"type"`
|
|
|
}{relationshipType}
|
|
|
|
|
|
- fmt.Println("Data: " + fmt.Sprintf("%v", data))
|
|
|
-
|
|
|
_, err = s.RequestWithBucketID("PUT", EndpointRelationship(userID), data, EndpointRelationships())
|
|
|
return
|
|
|
}
|