From 2b36e6f8b39538e221c12a8553fa52464c0c81ef Mon Sep 17 00:00:00 2001
From: Mathias Wagner <germannewsmaker@gmail.com>
Date: Sun, 29 Oct 2023 16:33:35 +0100
Subject: [PATCH] Updated the ready.cpp listener

---
 src/listeners/ready.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/listeners/ready.cpp b/src/listeners/ready.cpp
index e4829b7..e0c1c9f 100644
--- a/src/listeners/ready.cpp
+++ b/src/listeners/ready.cpp
@@ -18,9 +18,13 @@ std::thread ready::get_status_thread(dpp::cluster &bot) {
 }
 
 void ready::execute(dpp::cluster &bot, const dpp::ready_t &event) {
-    std::cout << "Logged in as " << event.from->creator->me.username << " (" << event.from->creator->me.id << ")"
+    std::cout << "Logged in as " << bot.me.username << " (" << bot.me.id << ")"
               << std::endl;
 
     std::thread status_thread = get_status_thread(bot);
     status_thread.detach();
+
+    if (dpp::run_once<struct register_bot_commands>()) {
+        bot.global_command_create(dpp::slashcommand("rules", "Shows you the rules of the global chat", bot.me.id));
+    }
 }