diff --git a/src/Commands/CommandType.cpp b/src/Commands/CommandType.cpp index 61e4012..577a16a 100644 --- a/src/Commands/CommandType.cpp +++ b/src/Commands/CommandType.cpp @@ -6,11 +6,14 @@ commands::ICommand::ICommand(std::shared_ptr botCluster) } std::shared_ptr commands::VCCommand::getQueue(const dpp::slashcommand_t& event) { - FMusicQueueID queueID; - queueID.guild_id = event.command.guild_id; - queueID.shard_id = event.from->shard_id; + auto findResult = queueMap->find(event.command.guild_id); + if (findResult == queueMap->end()) + { + FMusicQueueID queueID; + queueID.guild_id = event.command.guild_id; + queueID.shard_id = event.from->shard_id; - (*queueMap)[queueID.guild_id] = std::make_shared(queueID, botCluster); - - return queueMap->find(queueID.guild_id)->second; + (*queueMap)[queueID.guild_id] = std::make_shared(queueID, botCluster); + } + return queueMap->find(event.command.guild_id)->second; } \ No newline at end of file