Add ability to reply with embeds (#1160)

* Add ability to reply with embeds

* Fix typo in method comment
This commit is contained in:
Andrey Dudin 2022-05-14 22:56:30 +03:00 committed by GitHub
parent fa14e19ad5
commit e455362760
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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