mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2026-08-22 16:28:59 +09:00
2026-05-08기준 동작하도록 픽스
This commit is contained in:
+4
-3
@@ -15,7 +15,8 @@ aux_source_directory("src/Utils" settings)
|
||||
add_executable(${BOT_NAME} ${coresrc} ${commands} ${settings})
|
||||
|
||||
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_REQUIRED ON)
|
||||
|
||||
@@ -38,9 +39,9 @@ target_link_libraries(${BOT_NAME}
|
||||
ogg
|
||||
oggz
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${OPENSSL_CRYPTO_LIBRARY}
|
||||
${OPENSSL_CRYPTO_LIBRARY}
|
||||
${OPENSSL_SSL_LIBRARY}
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
||||
link_directories(/usr/lib)
|
||||
link_directories(/usr/lib)
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
FROM debian:sid
|
||||
WORKDIR /
|
||||
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 && \
|
||||
apt-get clean && \
|
||||
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 pycryptodome
|
||||
RUN curl -Lo dpp.deb https://dl.dpp.dev/
|
||||
|
||||
@@ -17,8 +17,9 @@ public:
|
||||
|
||||
static void validateFFMPEG(std::shared_ptr<dpp::cluster> cluster) {
|
||||
std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getFFMPEG_CMD(), {"-version"});
|
||||
std::string front = result.front();
|
||||
if (front[0] != 'f' ||
|
||||
std::string front = result.empty() ? "" : result.front();
|
||||
if (front.size() < 6 ||
|
||||
front[0] != 'f' ||
|
||||
front[1] != 'f' ||
|
||||
front[2] != 'm' ||
|
||||
front[3] != 'p' ||
|
||||
@@ -26,12 +27,12 @@ public:
|
||||
front[5] != 'g') {
|
||||
cluster->log(dpp::ll_warning, "ffmpeg is unavailable. downloading ffmpeg...");
|
||||
|
||||
if (!isThereCMD(cluster, "curl")) {
|
||||
exit(1);
|
||||
}
|
||||
if (!isThereCMD(cluster, "tar")) {
|
||||
exit(1);
|
||||
}
|
||||
// if (!isThereCMD(cluster, "curl")) {
|
||||
// exit(1);
|
||||
// }
|
||||
// if (!isThereCMD(cluster, "tar")) {
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
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");
|
||||
@@ -44,19 +45,20 @@ public:
|
||||
|
||||
static void validateYTDLP(std::shared_ptr<dpp::cluster> cluster) {
|
||||
std::queue<std::string> result = ConsoleUtils::safe_execute_command(SettingsManager::getYTDLP_CMD(), {"--version"});
|
||||
std::string front = result.front();
|
||||
if ((front[0]-'0' < 0 || front[0]-'0' > 9) ||
|
||||
std::string front = result.empty() ? "" : result.front();
|
||||
if (front.size() < 4 ||
|
||||
(front[0]-'0' < 0 || front[0]-'0' > 9) ||
|
||||
(front[1]-'0' < 0 || front[1]-'0' > 9) ||
|
||||
(front[2]-'0' < 0 || front[2]-'0' > 9) ||
|
||||
(front[3]-'0' < 0 || front[3]-'0' > 9)) {
|
||||
cluster->log(dpp::ll_warning, "ytdlp is unavailable. downloading ytdlp...");
|
||||
|
||||
if (!isThereCMD(cluster, "curl")) {
|
||||
exit(1);
|
||||
}
|
||||
if (!isThereCMD(cluster, "tar")) {
|
||||
exit(1);
|
||||
}
|
||||
// if (!isThereCMD(cluster, "curl")) {
|
||||
// exit(1);
|
||||
// }
|
||||
// if (!isThereCMD(cluster, "tar")) {
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
system("curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp");
|
||||
system("chmod +x ./yt-dlp");
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace bumbleBee::commands {
|
||||
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;
|
||||
|
||||
|
||||
if (!v) // v-> 로 nullptr을 참조하면 안 되므로.
|
||||
removed = musicManager->remove(event.command.guild_id, nullptr, pos);
|
||||
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("다음 항목을 큐에서 삭제했습니다!:");
|
||||
msg.add_embed(removed->embed);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace bumbleBee::commands {
|
||||
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()) {
|
||||
event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!"));
|
||||
@@ -12,8 +12,8 @@ namespace bumbleBee::commands {
|
||||
|
||||
v->voiceclient->stop_audio();
|
||||
v->voiceclient->pause_audio(true);
|
||||
event.from->clear_queue();
|
||||
event.from->disconnect_voice(event.command.guild_id);
|
||||
event.from()->clear_queue();
|
||||
event.from()->disconnect_voice(event.command.guild_id);
|
||||
|
||||
event.edit_original_response(dpp::message("음성 채팅방을 떠납니다!"));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bumbleBee::commands {
|
||||
event.reply("노래를 재생하려면 검색어 또는 링크를 입력해 주십시오.");
|
||||
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("노래를 재생할 음성 채팅방에 먼저 참가하고 신청해야 합니다!"));
|
||||
return;
|
||||
}
|
||||
@@ -202,14 +202,14 @@ namespace bumbleBee::commands {
|
||||
event.command.channel_id,
|
||||
query,
|
||||
event.command.usr,
|
||||
event.from->creator,
|
||||
event.from()->creator,
|
||||
musicManager);
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
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());
|
||||
msg.add_embed(musics.front()->embed);
|
||||
musics.pop();
|
||||
@@ -223,7 +223,7 @@ namespace bumbleBee::commands {
|
||||
}
|
||||
|
||||
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()) {
|
||||
event.edit_original_response(dpp::message("현재 음성 채팅방에 있는 상태가 아닙니다!"));
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace bumbleBee::commands {
|
||||
messageSentCondition.wait(lock, [&](){ return messagesent; });
|
||||
queued.pop();
|
||||
}
|
||||
}, queued, event.command.channel_id, event.from->creator);
|
||||
}, queued, event.command.channel_id, event.from()->creator);
|
||||
t.detach();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace bumbleBee::commands {
|
||||
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()) {
|
||||
event.edit_original_response(dpp::message("스킵하려면 음악을 재생중이어야 합니다!"));
|
||||
|
||||
Reference in New Issue
Block a user