diff --git a/src/commands/topic_cmd.cpp b/src/commands/topic_cmd.cpp index 55f1a97..4d01818 100644 --- a/src/commands/topic_cmd.cpp +++ b/src/commands/topic_cmd.cpp @@ -4,7 +4,17 @@ void cmd::topicCommand(dpp::cluster& bot, const dpp::slashcommand_t& event) { static int index; - const std::string topic = cmd::utils::readFileLine("res/topic.txt", index); + int maxLoadAttempts = 10; + + for(int i = 0; i < maxLoadAttempts; i++) // check if topic string is empty up to x amount of attempts + { + const std::string topic = cmd::utils::readFileLine("res/topic.txt", index); + if(topic.length() > 0) + { + break; + } + } + const dpp::embed embed = dpp::embed() .set_color(globals::color::defaultColor)