2026-05-08기준 동작하도록 픽스

This commit is contained in:
2026-05-08 16:21:07 +09:00
parent 77d16c1cdb
commit ca50deef5f
8 changed files with 36 additions and 32 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ aux_source_directory("src/Utils" settings)
add_executable(${BOT_NAME} ${coresrc} ${commands} ${settings}) add_executable(${BOT_NAME} ${coresrc} ${commands} ${settings})
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_BUILD_TYPE Debug) # set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
+2 -1
View File
@@ -1,10 +1,11 @@
FROM debian:sid FROM debian:sid
WORKDIR / WORKDIR /
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y curl libopus0 tini liboggz2 xz-utils ffmpeg python3 \ apt-get install -y curl libopus0 tini liboggz2 xz-utils ffmpeg python3 p7zip-full \
python3-pip python3-certifi python3-brotli python3-websockets python3-requests python3-mutagen && \ python3-pip python3-certifi python3-brotli python3-websockets python3-requests python3-mutagen && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deno.land/install.sh | sh
RUN pip3 install --break-system-packages --no-cache-dir curl_cffi RUN pip3 install --break-system-packages --no-cache-dir curl_cffi
RUN pip3 install --break-system-packages --no-cache-dir pycryptodome RUN pip3 install --break-system-packages --no-cache-dir pycryptodome
RUN curl -Lo dpp.deb https://dl.dpp.dev/ RUN curl -Lo dpp.deb https://dl.dpp.dev/
+18 -16
View File
@@ -17,8 +17,9 @@ public:
static void validateFFMPEG(std::shared_ptr<dpp::cluster> cluster) { static void validateFFMPEG(std::shared_ptr<dpp::cluster> cluster) {
std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getFFMPEG_CMD(), {"-version"}); std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getFFMPEG_CMD(), {"-version"});
std::string front = result.front(); std::string front = result.empty() ? "" : result.front();
if (front[0] != 'f' || if (front.size() < 6 ||
front[0] != 'f' ||
front[1] != 'f' || front[1] != 'f' ||
front[2] != 'm' || front[2] != 'm' ||
front[3] != 'p' || front[3] != 'p' ||
@@ -26,12 +27,12 @@ public:
front[5] != 'g') { front[5] != 'g') {
cluster->log(dpp::ll_warning, "ffmpeg is unavailable. downloading ffmpeg..."); cluster->log(dpp::ll_warning, "ffmpeg is unavailable. downloading ffmpeg...");
if (!isThereCMD(cluster, "curl")) { // if (!isThereCMD(cluster, "curl")) {
exit(1); // exit(1);
} // }
if (!isThereCMD(cluster, "tar")) { // if (!isThereCMD(cluster, "tar")) {
exit(1); // exit(1);
} // }
system("curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz"); system("curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz");
system("tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz"); system("tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz");
@@ -44,19 +45,20 @@ public:
static void validateYTDLP(std::shared_ptr<dpp::cluster> cluster) { static void validateYTDLP(std::shared_ptr<dpp::cluster> cluster) {
std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getYTDLP_CMD(), {"--version"}); std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getYTDLP_CMD(), {"--version"});
std::string front = result.front(); std::string front = result.empty() ? "" : result.front();
if ((front[0]-'0' < 0 || front[0]-'0' > 9) || if (front.size() < 4 ||
(front[0]-'0' < 0 || front[0]-'0' > 9) ||
(front[1]-'0' < 0 || front[1]-'0' > 9) || (front[1]-'0' < 0 || front[1]-'0' > 9) ||
(front[2]-'0' < 0 || front[2]-'0' > 9) || (front[2]-'0' < 0 || front[2]-'0' > 9) ||
(front[3]-'0' < 0 || front[3]-'0' > 9)) { (front[3]-'0' < 0 || front[3]-'0' > 9)) {
cluster->log(dpp::ll_warning, "ytdlp is unavailable. downloading ytdlp..."); cluster->log(dpp::ll_warning, "ytdlp is unavailable. downloading ytdlp...");
if (!isThereCMD(cluster, "curl")) { // if (!isThereCMD(cluster, "curl")) {
exit(1); // exit(1);
} // }
if (!isThereCMD(cluster, "tar")) { // if (!isThereCMD(cluster, "tar")) {
exit(1); // exit(1);
} // }
system("curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp"); system("curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp");
system("chmod +x ./yt-dlp"); system("chmod +x ./yt-dlp");
+2 -2
View File
@@ -11,14 +11,14 @@ namespace bumbleBee::commands {
return; return;
} }
dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id);
std::shared_ptr<MusicQueueElement> removed; std::shared_ptr<MusicQueueElement> removed;
if (!v) // v-> 로 nullptr을 참조하면 안 되므로. if (!v) // v-> 로 nullptr을 참조하면 안 되므로.
removed = musicManager->remove(event.command.guild_id, nullptr, pos); removed = musicManager->remove(event.command.guild_id, nullptr, pos);
else else
removed = musicManager->remove(event.command.guild_id, v->voiceclient, pos); removed = musicManager->remove(event.command.guild_id, v->voiceclient.get(), pos);
dpp::message msg("다음 항목을 큐에서 삭제했습니다!:"); dpp::message msg("다음 항목을 큐에서 삭제했습니다!:");
msg.add_embed(removed->embed); msg.add_embed(removed->embed);
+3 -3
View File
@@ -2,7 +2,7 @@
namespace bumbleBee::commands { namespace bumbleBee::commands {
void Leave::execute(const dpp::slashcommand_t &event) { void Leave::execute(const dpp::slashcommand_t &event) {
dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id);
if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {
event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!")); event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!"));
@@ -12,8 +12,8 @@ namespace bumbleBee::commands {
v->voiceclient->stop_audio(); v->voiceclient->stop_audio();
v->voiceclient->pause_audio(true); v->voiceclient->pause_audio(true);
event.from->clear_queue(); event.from()->clear_queue();
event.from->disconnect_voice(event.command.guild_id); event.from()->disconnect_voice(event.command.guild_id);
event.edit_original_response(dpp::message("음성 채팅방을 떠납니다!")); event.edit_original_response(dpp::message("음성 채팅방을 떠납니다!"));
} }
+4 -4
View File
@@ -19,7 +19,7 @@ namespace bumbleBee::commands {
event.reply("노래를 재생하려면 검색어 또는 링크를 입력해 주십시오."); event.reply("노래를 재생하려면 검색어 또는 링크를 입력해 주십시오.");
return; return;
} }
if (!event.from->get_voice(event.command.guild_id) && !g->connect_member_voice(event.command.usr.id)) { if (!event.from()->get_voice(event.command.guild_id) && !g->connect_member_voice(*event.from()->creator, event.command.usr.id)) {
event.edit_original_response(dpp::message("노래를 재생할 음성 채팅방에 먼저 참가하고 신청해야 합니다!")); event.edit_original_response(dpp::message("노래를 재생할 음성 채팅방에 먼저 참가하고 신청해야 합니다!"));
return; return;
} }
@@ -202,14 +202,14 @@ namespace bumbleBee::commands {
event.command.channel_id, event.command.channel_id,
query, query,
event.command.usr, event.command.usr,
event.from->creator, event.from()->creator,
musicManager); musicManager);
t.detach(); t.detach();
} }
if (!musics.empty()) { if (!musics.empty()) {
event.from->creator->log(dpp::ll_info, "Enqueuing " + musics.front()->embed.title + " - " + musics.front()->id); event.from()->creator->log(dpp::ll_info, "Enqueuing " + musics.front()->embed.title + " - " + musics.front()->id);
musicManager->queue_music(event.command.guild_id, musics.front()); musicManager->queue_music(event.command.guild_id, musics.front());
msg.add_embed(musics.front()->embed); msg.add_embed(musics.front()->embed);
musics.pop(); musics.pop();
@@ -223,7 +223,7 @@ namespace bumbleBee::commands {
} }
if (musicManager->getNowPlaying(event.command.guild_id).id == "") { if (musicManager->getNowPlaying(event.command.guild_id).id == "") {
dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id);
if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {
event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!")); event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!"));
+1 -1
View File
@@ -64,7 +64,7 @@ namespace bumbleBee::commands {
messageSentCondition.wait(lock, [&](){ return messagesent; }); messageSentCondition.wait(lock, [&](){ return messagesent; });
queued.pop(); queued.pop();
} }
}, queued, event.command.channel_id, event.from->creator); }, queued, event.command.channel_id, event.from()->creator);
t.detach(); t.detach();
} }
+1 -1
View File
@@ -2,7 +2,7 @@
namespace bumbleBee::commands { namespace bumbleBee::commands {
void Skip::execute(const dpp::slashcommand_t &event) { void Skip::execute(const dpp::slashcommand_t &event) {
dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id);
if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {
event.edit_original_response(dpp::message("스킵하려면 음악을 재생중이어야 합니다!")); event.edit_original_response(dpp::message("스킵하려면 음악을 재생중이어야 합니다!"));