diff options
author | Cara Salter <cara@devcara.com> | 2023-04-15 10:37:45 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-04-15 10:37:45 -0400 |
commit | 5058c8bbeff6b659787a8ab482ac89fc4a194076 (patch) | |
tree | ef768f7aa54482469c38e5bb818f96740dae85a0 /src/modules.cpp | |
parent | 8edf3bf0ca81b942a165cde3bdea11ca755da955 (diff) | |
download | 142bot-5058c8bbeff6b659787a8ab482ac89fc4a194076.tar.gz 142bot-5058c8bbeff6b659787a8ab482ac89fc4a194076.zip |
init spotify
Change-Id: I6796976649ee59f4e647148e77d76effa7315f73
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 4b636f9..e784c0c 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -470,4 +470,39 @@ void Module::EmbedSimple(const std::string &message, int64_t channelID) } else { bot->core->log(dpp::ll_error, fmt::format("Invalid channel {} passed to EmbedSimple", channelID)); } +} + +void Module::EmbedError(int64_t channelId, std::exception &e) { + std::string msg = "Got an error running that command!\n\n```"; + msg.append(e.what()); + msg.append("\n```"); + dpp::embed embed = dpp::embed() + .set_color(dpp::colors::red) + .set_title("Error") + .set_description(msg); + + bot->core->message_create(dpp::message(channelId, embed)); +} + + +void Module::EmbedError(const std::string &message, int64_t channelId) { + std::string msg = "Got an error running that command!\n\n```"; + msg.append(message); + msg.append("\n```"); + dpp::embed embed = dpp::embed() + .set_color(dpp::colors::red) + .set_title("Error") + .set_description(msg); + + bot->core->message_create(dpp::message(channelId, embed)); +} + + +void Module::EmbedSuccess(const std::string &message, int64_t channelId) { + dpp::embed embed = dpp::embed() + .set_color(dpp::colors::green) + .set_title("Success!") + .set_description(message); + + bot->core->message_create(dpp::message(channelId, embed)); }
\ No newline at end of file |