aboutsummaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp35
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