Skip to content

Commit

Permalink
add backwards compat for sendMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
yourWaifu committed Oct 15, 2023
1 parent cbc9db5 commit 13a3e25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/sleepy_discord/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace SleepyDiscord {
//For Convenience
inline ObjectResponse<Message> editMessage(Message message, std::string newMessage, std::vector<Embed> embeds = {}) { return editMessage(message.channelID, message.ID, newMessage, embeds); }
inline ObjectResponse<Message> sendMessage(Snowflake<Channel> channelID, std::string message, RequestSettings<ObjectResponse<Message>> settings) {
return sendMessage(channelID, message, {}, MessageReference{}, TTS::Default, settings);
return sendMessage(channelID, message, std::vector<Embed>{}, MessageReference{}, TTS::Default, settings);
}

//server functions
Expand Down
2 changes: 1 addition & 1 deletion sleepy_discord/endpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace SleepyDiscord {
}

ObjectResponse<Message> BaseDiscordClient::sendMessage(Snowflake<Channel> channelID, std::string message, Embed embed, MessageReference replyingTo, TTS tts, RequestSettings<ObjectResponse<Message>> settings) {
return ObjectResponse<Message>{ request(Post, path("channels/{channel.id}/messages", { channelID }), settings, createMessageBody(message, embed.empty() ? {} : { embed }, replyingTo, tts)) }
return ObjectResponse<Message>{ request(Post, path("channels/{channel.id}/messages", { channelID }), settings, createMessageBody(message, embed.empty() ? std::vector<Embed>() : std::vector<Embed>({ std::move(embed) }), replyingTo, tts)) };
}

ObjectResponse<Message> BaseDiscordClient::sendMessage(SendMessageParams params, RequestSettings<ObjectResponse<Message>> settings) {
Expand Down

0 comments on commit 13a3e25

Please sign in to comment.