diff --git a/.gitmodules b/.gitmodules index d3ee157..7256a76 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "DPP"] path = DPP url = https://github.com/brainboxdotcc/DPP.git -[submodule "libjustgpt"] - path = libjustgpt - url = https://gitlab.com/niansa/libjustgpt.git [submodule "luau"] path = luau url = https://github.com/Roblox/luau.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ec54228..97ba6ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,6 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_subdirectory(DPP) -add_subdirectory(libjustgpt) set(LUAU_BUILD_TESTS No) add_subdirectory(luau) set(LUABRIDGE_TESTING No) @@ -20,7 +19,7 @@ add_compile_definitions(COMPILER_PLATFORM="${CMAKE_CXX_PLATFORM_ID}") file(GLOB MODULES modules/*.cpp modules/*.hpp) add_executable(KeineAhnung main.cpp util.cpp ${MODULES}) -target_link_libraries(KeineAhnung PRIVATE dpp justgpt sqlite3 pthread Luau.VM Luau.Compiler LuaBridge) +target_link_libraries(KeineAhnung PRIVATE dpp sqlite3 pthread Luau.VM Luau.Compiler LuaBridge) if (CMAKE_BUILD_TYPE STREQUAL "Release") set_property(TARGET KeineAhnung PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) message(STATUS "Interprocedural optimization is enabled") diff --git a/DPP b/DPP index 22ca035..ac9081f 160000 --- a/DPP +++ b/DPP @@ -1 +1 @@ -Subproject commit 22ca0359bce9034b55a754d848212e290d762a57 +Subproject commit ac9081f77b5f9cd954f2936bcc5b5495dfb311cd diff --git a/libjustgpt b/libjustgpt deleted file mode 160000 index fba3475..0000000 --- a/libjustgpt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fba3475a92b7aec01ec372ac08002d386e7acc0e diff --git a/luau b/luau index 48172dd..36e0e64 160000 --- a/luau +++ b/luau @@ -1 +1 @@ -Subproject commit 48172dd5b139e410e6d1b0b1821340bc491cde9a +Subproject commit 36e0e6471567eb0d41d80e54b73db791efbb808a diff --git a/modules/fun.cpp b/modules/fun.cpp index 9f3fba9..c917082 100644 --- a/modules/fun.cpp +++ b/modules/fun.cpp @@ -2,62 +2,16 @@ #include -#include - class Fun { Bot *bot; - const std::string_view ai_init_prompt = -R"( Hello - Hi! - How are you? - Great! - What is your favorite color? - Green! - What is your name? - I don't have a name. - How are you? - Good. - )"; - - Ai ai; - - std::string chat_reply(const std::string& message) { - auto prompt = std::string(ai_init_prompt)+message+"\n"; - return ai.complete(prompt, '\n'); - } - public: Fun(Bot *_bot) : bot(_bot) { - bot->cluster.on_message_create([&](const dpp::message_create_t& message) { - // Chat with bot - if (message.msg.content[0] == '-') { - auto content = message.msg.content; - content.erase(0, 1); - for (auto& c : content) { - if (c == '\n') - c = ' '; - } - auto reply = chat_reply(content); - message.reply(reply); - return; - } - }); - bot->add_chatcommand(Bot::ChatCommand({"ping"}, "Ping pong!"), [&](const dpp::slashcommand_t& event) { event.reply(dpp::message("Pong!").set_flags(dpp::message_flags::m_ephemeral)); }); - bot->add_chatcommand(Bot::ChatCommand({"chat"}, "Chat with me (english)", dpp::slashcommand().add_option(dpp::command_option(dpp::command_option_type::co_string, "message", "Your message", true))), [&](const dpp::slashcommand_t& event) { - auto& content = std::get(event.get_parameter("message")); - event.thinking(false); - std::thread([=]() { - auto reply = chat_reply(content); - event.delete_original_response(); - bot->cluster.message_create(dpp::message(event.command.channel_id, event.command.member.get_mention()+" asked:\n> "+content+"\nI reply:\n> "+reply)); - }).detach(); - }); bot->add_chatcommand(Bot::ChatCommand({"cat", "katze"}, "Generiere eine Katze"), [&](const dpp::slashcommand_t& event) { event.reply("https://thiscatdoesnotexist.com/?"+std::to_string(event.command.id)); });