diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-14 02:36:04 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-14 02:36:04 -0400 |
commit | 4456c8771da668cbadb411583624fe0e357fa687 (patch) | |
tree | 789e2d73e6f0994b314b8e18c9cb8209562666e2 /src/discord/discord.hpp | |
parent | caa551a4693c7c7ef475be515b31eb025bc7df96 (diff) | |
download | abaddon-portaudio-4456c8771da668cbadb411583624fe0e357fa687.tar.gz abaddon-portaudio-4456c8771da668cbadb411583624fe0e357fa687.zip |
refactor send message params into one struct
Diffstat (limited to 'src/discord/discord.hpp')
-rw-r--r-- | src/discord/discord.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/discord/discord.hpp b/src/discord/discord.hpp index 9322e3f..41d5aab 100644 --- a/src/discord/discord.hpp +++ b/src/discord/discord.hpp @@ -3,6 +3,7 @@ #include "httpclient.hpp" #include "objects.hpp" #include "store.hpp" +#include "chatsubmitparams.hpp" #include <sigc++/sigc++.h> #include <nlohmann/json.hpp> #include <thread> @@ -103,10 +104,11 @@ public: Permission ComputeOverwrites(Permission base, Snowflake member_id, Snowflake channel_id) const; bool CanManageMember(Snowflake guild_id, Snowflake actor, Snowflake target) const; // kick, ban, edit nickname (cant think of a better name) - void ChatMessageCallback(const std::string &nonce, const http::response_type &response); + void ChatMessageCallback(const std::string &nonce, const http::response_type &response, const sigc::slot<void(DiscordError code)> &callback); + void SendChatMessageNoAttachments(const ChatSubmitParams ¶ms, const sigc::slot<void(DiscordError code)> &callback); + void SendChatMessageAttachments(const ChatSubmitParams ¶ms, const sigc::slot<void(DiscordError code)> &callback); - void SendChatMessage(const std::string &content, const std::vector<std::string> &attachment_paths, Snowflake channel); - void SendChatMessage(const std::string &content, const std::vector<std::string> &attachment_paths, Snowflake channel, Snowflake referenced_message); + void SendChatMessage(const ChatSubmitParams ¶ms, const sigc::slot<void(DiscordError code)> &callback); void DeleteMessage(Snowflake channel_id, Snowflake id); void EditMessage(Snowflake channel_id, Snowflake id, std::string content); void SendLazyLoad(Snowflake id); @@ -224,9 +226,6 @@ private: std::vector<uint8_t> m_decompress_buf; z_stream m_zstream; - void SendChatMessageAttachments(const std::string &content, const std::vector<std::string> &attachment_paths, Snowflake channel, Snowflake referenced_message = Snowflake::Invalid); - void SendChatMessageText(const std::string &content, Snowflake channel, Snowflake referenced_message = Snowflake::Invalid); - static std::string GetAPIURL(); static std::string GetGatewayURL(); |