This commit is contained in:
2024-01-22 03:26:22 +09:00
parent c996f290db
commit b7b1018871
18 changed files with 118 additions and 134 deletions

View File

@@ -3,7 +3,7 @@
#include <string>
commands::Repeat::Repeat(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap)
: ICommand(botCluster)
: VCCommand(botCluster)
{
this->queueMap = queueMap;
dpp::slashcommand command = dpp::slashcommand("r", "반복 켜기/끄기", botCluster->me.id);
@@ -12,16 +12,7 @@ commands::Repeat::Repeat(std::shared_ptr<dpp::cluster> botCluster, std::unordere
}
void commands::Repeat::operator()(const dpp::slashcommand_t& event) {
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<MusicQueue>(queueID);
}
std::shared_ptr<MusicQueue> queue = queueMap->find(event.command.guild_id)->second;
std::shared_ptr<MusicQueue> queue = getQueue(event);
if (queue->repeat) {
event.reply("반복을 껐습니다.");