Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/commands/topic_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down