스킵 구현

This commit is contained in:
2023-12-20 19:45:25 +09:00
parent 6503fd167b
commit 8a987320e0
775 changed files with 162601 additions and 135 deletions

31
src/Commands/Skip.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <Commands/Skip.hpp>
#include <dpp/dpp.h>
#include <dpp/nlohmann/json.hpp>
#include <string>
#include <ctime>
using json = nlohmann::json;
Skip::Skip(std::shared_ptr<BumbleCeepp> Bot) {
this->Bot = Bot;
dpp::slashcommand Command = dpp::slashcommand("skip", "현재곡 스킵", Bot->BotCluster->me.id);
dpp::slashcommand Alias = dpp::slashcommand("s", "현재곡 스킵", Bot->BotCluster->me.id);
CommandObjectVector.push_back(Command);
CommandObjectVector.push_back(Alias);
}
void Skip::operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event) {
dpp::voiceconn* v = Event.from->get_voice(Event.command.guild_id);
if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {
return;
}
v->voiceclient->stop_audio();
Event.reply("스킵했습니다!");
return;
}