Skip to content

Commit

Permalink
feat: ✨ add reply method to CreateMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Xminent committed Dec 30, 2023
1 parent 09d2773 commit 54d8176
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/ekizu/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ struct MessageInteraction {
std::optional<PartialMember> member;
};

/**
* @see
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
struct MessageReference {
/// The ID of the originating message.
std::optional<Snowflake> message_id;
Expand Down
5 changes: 5 additions & 0 deletions include/ekizu/request/create_message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ struct CreateMessage {
return *this;
}

CreateMessage &reply(Snowflake message_id) {
m_fields.message_reference = {message_id, m_channel_id};
return *this;
}

CreateMessage &sticker_ids(const std::vector<Snowflake> &sticker_ids) {
m_fields.sticker_ids = sticker_ids;
return *this;
Expand Down

0 comments on commit 54d8176

Please sign in to comment.