From 5058c8bbeff6b659787a8ab482ac89fc4a194076 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sat, 15 Apr 2023 10:37:45 -0400 Subject: init spotify Change-Id: I6796976649ee59f4e647148e77d76effa7315f73 --- src/modules.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/modules.cpp') 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 -- cgit v1.2.3