From e62a862e4230cefd2220df1197126c8bc8d297d6 Mon Sep 17 00:00:00 2001 From: HappyTanuki Date: Fri, 2 Aug 2024 00:10:03 +0900 Subject: [PATCH] =?UTF-8?q?=ED=81=90=EB=B2=84=EA=B7=B8=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Commands/CommandType.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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