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 ability to reply with embeds #1160

Merged
merged 2 commits into from May 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions restapi.go
Expand Up @@ -1722,6 +1722,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