Skip to content

Commit

Permalink
Add ability to reply with embeds (#1160)
Browse files Browse the repository at this point in the history
* Add ability to reply with embeds

* Fix typo in method comment
  • Loading branch information
Tri0L committed May 14, 2022
1 parent fa14e19 commit e455362
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions restapi.go
Expand Up @@ -1729,6 +1729,28 @@ func (s *Session) ChannelMessageSendReply(channelID string, content string, refe
})
}

// ChannelMessageSendEmbedReply sends a message to the given channel with reference data and embedded data.
// channelID : The ID of a Channel.
// embed : The embed data to send.
// reference : The message reference to send.
func (s *Session) ChannelMessageSendEmbedReply(channelID string, embed *MessageEmbed, reference *MessageReference) (*Message, error) {
return s.ChannelMessageSendEmbedsReply(channelID, []*MessageEmbed{embed}, reference)
}

// ChannelMessageSendEmbedsReply sends a message to the given channel with reference data and multiple embedded data.
// channelID : The ID of a Channel.
// embeds : The embeds data to send.
// reference : The message reference to send.
func (s *Session) ChannelMessageSendEmbedsReply(channelID string, embeds []*MessageEmbed, reference *MessageReference) (*Message, error) {
if reference == nil {
return nil, fmt.Errorf("reply attempted with nil message reference")
}
return s.ChannelMessageSendComplex(channelID, &MessageSend{
Embeds: embeds,
Reference: reference,
})
}

// ChannelMessageEdit edits an existing message, replacing it entirely with
// the given content.
// channelID : The ID of a Channel
Expand Down

0 comments on commit e455362

Please sign in to comment.