├── .github └── workflows │ ├── ci.yml │ └── update.yml ├── .gitignore ├── LICENSE ├── MyBot.sln ├── MyBot ├── MyBot.cpp ├── MyBot.h ├── MyBot.vcxproj ├── MyBot.vcxproj.filters └── dependencies │ ├── 32 │ ├── debug │ │ ├── bin │ │ │ ├── dpp.dll │ │ │ ├── libcrypto-1_1.dll │ │ │ ├── libssl-1_1.dll │ │ │ ├── opus.dll │ │ │ └── zlib1.dll │ │ └── lib │ │ │ ├── cmake │ │ │ └── dpp │ │ │ │ ├── dpp-config-version.cmake │ │ │ │ ├── dpp-config.cmake │ │ │ │ ├── dpp-release.cmake │ │ │ │ ├── dpp.cmake │ │ │ │ └── libdpp-config.cmake │ │ │ └── dpp-10.1 │ │ │ └── dpp.lib │ └── release │ │ ├── bin │ │ ├── dpp.dll │ │ ├── libcrypto-1_1.dll │ │ ├── libssl-1_1.dll │ │ ├── opus.dll │ │ └── zlib1.dll │ │ └── lib │ │ ├── cmake │ │ └── dpp │ │ │ ├── dpp-config-version.cmake │ │ │ ├── dpp-config.cmake │ │ │ ├── dpp-release.cmake │ │ │ ├── dpp.cmake │ │ │ └── libdpp-config.cmake │ │ └── dpp-10.1 │ │ └── dpp.lib │ ├── 64 │ ├── debug │ │ ├── bin │ │ │ ├── dpp.dll │ │ │ ├── libcrypto-1_1-x64.dll │ │ │ ├── libssl-1_1-x64.dll │ │ │ ├── opus.dll │ │ │ └── zlib1.dll │ │ └── lib │ │ │ ├── cmake │ │ │ └── dpp │ │ │ │ ├── dpp-config-version.cmake │ │ │ │ ├── dpp-config.cmake │ │ │ │ ├── dpp-release.cmake │ │ │ │ ├── dpp.cmake │ │ │ │ └── libdpp-config.cmake │ │ │ └── dpp-10.1 │ │ │ └── dpp.lib │ └── release │ │ ├── bin │ │ ├── dpp.dll │ │ ├── libcrypto-1_1-x64.dll │ │ ├── libssl-1_1-x64.dll │ │ ├── opus.dll │ │ └── zlib1.dll │ │ └── lib │ │ ├── cmake │ │ └── dpp │ │ │ ├── dpp-config-version.cmake │ │ │ ├── dpp-config.cmake │ │ │ ├── dpp-release.cmake │ │ │ ├── dpp.cmake │ │ │ └── libdpp-config.cmake │ │ └── dpp-10.1 │ │ └── dpp.lib │ └── include │ └── dpp-10.1 │ └── dpp │ ├── appcommand.h │ ├── application.h │ ├── auditlog.h │ ├── automod.h │ ├── ban.h │ ├── bignum.h │ ├── cache.h │ ├── channel.h │ ├── cluster.h │ ├── cluster_coro_calls.h │ ├── collector.h │ ├── colors.h │ ├── commandhandler.h │ ├── coro.h │ ├── coro │ ├── async.h │ ├── awaitable.h │ ├── coro.h │ ├── coroutine.h │ ├── job.h │ ├── task.h │ └── when_any.h │ ├── discord_webhook_server.h │ ├── discordclient.h │ ├── discordevents.h │ ├── discordvoiceclient.h │ ├── dispatcher.h │ ├── dns.h │ ├── dpp.h │ ├── dtemplate.h │ ├── emoji.h │ ├── entitlement.h │ ├── etf.h │ ├── event.h │ ├── event_router.h │ ├── exception.h │ ├── export.h │ ├── guild.h │ ├── http_server.h │ ├── http_server_request.h │ ├── httpsclient.h │ ├── integration.h │ ├── intents.h │ ├── invite.h │ ├── isa │ ├── avx.h │ ├── avx2.h │ ├── avx512.h │ ├── fallback.h │ └── neon.h │ ├── isa_detection.h │ ├── json.h │ ├── json_fwd.h │ ├── json_interface.h │ ├── managed.h │ ├── message.h │ ├── misc-enum.h │ ├── nlohmann │ ├── json.hpp │ └── json_fwd.hpp │ ├── once.h │ ├── permissions.h │ ├── presence.h │ ├── prune.h │ ├── queues.h │ ├── restrequest.h │ ├── restresults.h │ ├── role.h │ ├── scheduled_event.h │ ├── signature_verifier.h │ ├── sku.h │ ├── snowflake.h │ ├── socket.h │ ├── socket_listener.h │ ├── socketengine.h │ ├── ssl_context.h │ ├── sslclient.h │ ├── sslconnection.h │ ├── stage_instance.h │ ├── stringops.h │ ├── sysdep.h │ ├── thread.h │ ├── thread_pool.h │ ├── timed_listener.h │ ├── timer.h │ ├── unicode_emoji.h │ ├── user.h │ ├── utility.h │ ├── version.h │ ├── voiceregion.h │ ├── voicestate.h │ ├── webhook.h │ ├── win32_safe_warnings.h │ ├── wrapped_ssl_ctx.h │ ├── wsclient.h │ └── zlibcontext.h ├── README.md ├── SECURITY.md └── updatedpp.sh /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Windows Template CI 2 | on: 3 | schedule: 4 | - cron: '0 11,23 * * *' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | windows: # Windows x64 and x86 build matrix 9 | strategy: 10 | fail-fast: false # Don't cancel other matrix jobs if one fails 11 | matrix: 12 | cfg: 13 | - { name: x64, arch: x64, config: Release, os: 'windows-2022' } 14 | - { name: x64, arch: x64, config: Debug, os: 'windows-2022' } 15 | - { name: x86, arch: x86, config: Release, os: 'windows-2022' } 16 | - { name: x86, arch: x86, config: Debug, os: 'windows-2022' } 17 | 18 | name: "Windows ${{matrix.cfg.name}}-${{matrix.cfg.config}}" 19 | runs-on: ${{matrix.cfg.os}} 20 | steps: 21 | - name: Checkout windows-bot-template 22 | uses: actions/checkout@v2 23 | 24 | - name: Add MSBuild to PATH 25 | uses: microsoft/setup-msbuild@v1.1.3 26 | 27 | - name: Build Project 28 | run: msbuild /p:DPP_CI=1 /p:DPP_WIN_TEMPLATE=1 /p:Configuration=${{matrix.cfg.config}} /p:Platform="${{matrix.cfg.arch}}" 29 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: Library Binaries Update 2 | on: 3 | schedule: 4 | - cron: '*/15 * * * *' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | updater: 9 | name: Update latest D++ 10 | runs-on: ubuntu-20.04 11 | strategy: 12 | fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually 13 | 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | 17 | steps: 18 | - name: Install apt packages 19 | run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install unzip dos2unix && git config --global user.email "updatebot@dpp.dev" && git config --global user.name "D++ Update Bot" 20 | 21 | - name: Checkout repository 22 | uses: actions/checkout@v2 23 | 24 | - name: Run updater 25 | run: pwd && ./updatedpp.sh 26 | 27 | -------------------------------------------------------------------------------- /MyBot.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31515.178 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyBot", "MyBot\MyBot.vcxproj", "{3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Debug|x64.ActiveCfg = Debug|x64 17 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Debug|x64.Build.0 = Debug|x64 18 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Debug|x86.ActiveCfg = Debug|Win32 19 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Debug|x86.Build.0 = Debug|Win32 20 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Release|x64.ActiveCfg = Release|x64 21 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Release|x64.Build.0 = Release|x64 22 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Release|x86.ActiveCfg = Release|Win32 23 | {3BCAA106-D9D9-43AB-AF92-01C943F4FEC2}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {4316AD79-3D59-4C1B-9DE2-6619B51AE700} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /MyBot/MyBot.cpp: -------------------------------------------------------------------------------- 1 | #include "MyBot.h" 2 | #include 3 | 4 | /* Be sure to place your token in the line below. 5 | * Follow steps here to get a token: 6 | * https://dpp.dev/creating-a-bot-application.html 7 | * When you invite the bot, be sure to invite it with the 8 | * scopes 'bot' and 'applications.commands', e.g. 9 | * https://discord.com/oauth2/authorize?client_id=940762342495518720&scope=bot+applications.commands&permissions=139586816064 10 | */ 11 | const std::string BOT_TOKEN = "add your token here"; 12 | 13 | int main() 14 | { 15 | /* Create bot cluster */ 16 | dpp::cluster bot(BOT_TOKEN); 17 | 18 | /* Output simple log messages to stdout */ 19 | bot.on_log(dpp::utility::cout_logger()); 20 | 21 | /* Register slash command here in on_ready */ 22 | bot.on_ready([&bot](const dpp::ready_t& event) { 23 | /* Wrap command registration in run_once to make sure it doesnt run on every full reconnection */ 24 | if (dpp::run_once()) { 25 | std::vector commands { 26 | { "ping", "Ping pong!", bot.me.id } 27 | }; 28 | 29 | bot.global_bulk_command_create(commands); 30 | } 31 | }); 32 | 33 | /* Handle slash command with the most recent addition to D++ features, coroutines! */ 34 | bot.on_slashcommand([](const dpp::slashcommand_t& event) -> dpp::task { 35 | if (event.command.get_command_name() == "ping") { 36 | co_await event.co_reply("Pong!"); 37 | } 38 | co_return; 39 | }); 40 | 41 | /* Start the bot */ 42 | bot.start(dpp::st_wait); 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /MyBot/MyBot.h: -------------------------------------------------------------------------------- 1 | /* Some user friendly sanity checks to cut down on silly support issues */ 2 | 3 | #if !defined(_MSC_VER) || (_MSC_VER < 1929) 4 | #error "This template is only for Microsoft Visual C++ 2019 and later. To build a D++ bot in Visual Studio Code, or on any other platform or compiler please use https://github.com/brainboxdotcc/templatebot" 5 | #endif 6 | 7 | #if (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L) 8 | #error "D++ bots require C++17 or later. Please enable C++17 under project properties." 9 | #endif 10 | 11 | #if !defined(DPP_WIN_TEMPLATE) && !defined(DPP_CI) 12 | #error "You must compile this template using its .sln file. You cannot just double click the .cpp file and compile it on its own. Ensure you checked out the full source code of the template!" 13 | #endif 14 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/bin/dpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/bin/dpp.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/bin/libcrypto-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/bin/libcrypto-1_1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/bin/libssl-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/bin/libssl-1_1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/bin/opus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/bin/opus.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/bin/zlib1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/cmake/dpp/dpp-config-version.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "10.1.3") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("10.1.3" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) 21 | string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") 22 | endif() 23 | else() 24 | set(CVF_VERSION_MAJOR "10.1.3") 25 | endif() 26 | 27 | if(PACKAGE_FIND_VERSION_RANGE) 28 | # both endpoints of the range must have the expected major version 29 | math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") 30 | if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 31 | OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) 32 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) 33 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 34 | elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 35 | AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) 36 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) 37 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 38 | else() 39 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 40 | endif() 41 | else() 42 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 43 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 44 | else() 45 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 46 | endif() 47 | 48 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 49 | set(PACKAGE_VERSION_EXACT TRUE) 50 | endif() 51 | endif() 52 | endif() 53 | 54 | 55 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 56 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "") 57 | return() 58 | endif() 59 | 60 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 61 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "") 62 | math(EXPR installedBits " * 8") 63 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 64 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 65 | endif() 66 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/cmake/dpp/dpp-config.cmake: -------------------------------------------------------------------------------- 1 | # dpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/cmake/dpp/dpp-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "dpp::dpp" for configuration "Release" 9 | set_property(TARGET dpp::dpp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(dpp::dpp PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/dpp.dll" 13 | ) 14 | 15 | list(APPEND _cmake_import_check_targets dpp::dpp ) 16 | list(APPEND _cmake_import_check_files_for_dpp::dpp "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" "${_IMPORT_PREFIX}/bin/dpp.dll" ) 17 | 18 | # Commands beyond this point should not need to know the version. 19 | set(CMAKE_IMPORT_FILE_VERSION) 20 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/cmake/dpp/dpp.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) 4 | message(FATAL_ERROR "CMake >= 2.8.12 required") 5 | endif() 6 | if(CMAKE_VERSION VERSION_LESS "2.8.12") 7 | message(FATAL_ERROR "CMake >= 2.8.12 required") 8 | endif() 9 | cmake_policy(PUSH) 10 | cmake_policy(VERSION 2.8.12...3.29) 11 | #---------------------------------------------------------------- 12 | # Generated CMake target import file. 13 | #---------------------------------------------------------------- 14 | 15 | # Commands may need to know the format version. 16 | set(CMAKE_IMPORT_FILE_VERSION 1) 17 | 18 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 19 | set(_cmake_targets_defined "") 20 | set(_cmake_targets_not_defined "") 21 | set(_cmake_expected_targets "") 22 | foreach(_cmake_expected_target IN ITEMS dpp::dpp) 23 | list(APPEND _cmake_expected_targets "${_cmake_expected_target}") 24 | if(TARGET "${_cmake_expected_target}") 25 | list(APPEND _cmake_targets_defined "${_cmake_expected_target}") 26 | else() 27 | list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") 28 | endif() 29 | endforeach() 30 | unset(_cmake_expected_target) 31 | if(_cmake_targets_defined STREQUAL _cmake_expected_targets) 32 | unset(_cmake_targets_defined) 33 | unset(_cmake_targets_not_defined) 34 | unset(_cmake_expected_targets) 35 | unset(CMAKE_IMPORT_FILE_VERSION) 36 | cmake_policy(POP) 37 | return() 38 | endif() 39 | if(NOT _cmake_targets_defined STREQUAL "") 40 | string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") 41 | string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") 42 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") 43 | endif() 44 | unset(_cmake_targets_defined) 45 | unset(_cmake_targets_not_defined) 46 | unset(_cmake_expected_targets) 47 | 48 | 49 | # Compute the installation prefix relative to this file. 50 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 52 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 53 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 54 | if(_IMPORT_PREFIX STREQUAL "/") 55 | set(_IMPORT_PREFIX "") 56 | endif() 57 | 58 | # Create imported target dpp::dpp 59 | add_library(dpp::dpp SHARED IMPORTED) 60 | 61 | set_target_properties(dpp::dpp PROPERTIES 62 | INTERFACE_COMPILE_FEATURES "cxx_std_17;cxx_std_20" 63 | INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/dpp-10.1" 64 | INTERFACE_LINK_LIBRARIES "D:/a/DPP/DPP/main/win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib;D:/a/DPP/DPP/main/win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib" 65 | ) 66 | 67 | # Load information for each installed configuration. 68 | file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dpp-*.cmake") 69 | foreach(_cmake_config_file IN LISTS _cmake_config_files) 70 | include("${_cmake_config_file}") 71 | endforeach() 72 | unset(_cmake_config_file) 73 | unset(_cmake_config_files) 74 | 75 | # Cleanup temporary variables. 76 | set(_IMPORT_PREFIX) 77 | 78 | # Loop over all imported files and verify that they actually exist 79 | foreach(_cmake_target IN LISTS _cmake_import_check_targets) 80 | if(CMAKE_VERSION VERSION_LESS "3.28" 81 | OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} 82 | OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") 83 | foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") 84 | if(NOT EXISTS "${_cmake_file}") 85 | message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file 86 | \"${_cmake_file}\" 87 | but this file does not exist. Possible reasons include: 88 | * The file was deleted, renamed, or moved to another location. 89 | * An install or uninstall procedure did not complete successfully. 90 | * The installation package was faulty and contained 91 | \"${CMAKE_CURRENT_LIST_FILE}\" 92 | but not all the files it references. 93 | ") 94 | endif() 95 | endforeach() 96 | endif() 97 | unset(_cmake_file) 98 | unset("_cmake_import_check_files_for_${_cmake_target}") 99 | endforeach() 100 | unset(_cmake_target) 101 | unset(_cmake_import_check_targets) 102 | 103 | # This file does not depend on other imported targets which have 104 | # been exported from the same project but in a separate export set. 105 | 106 | # Commands beyond this point should not need to know the version. 107 | set(CMAKE_IMPORT_FILE_VERSION) 108 | cmake_policy(POP) 109 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/cmake/dpp/libdpp-config.cmake: -------------------------------------------------------------------------------- 1 | # libdpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/debug/lib/dpp-10.1/dpp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/debug/lib/dpp-10.1/dpp.lib -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/bin/dpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/bin/dpp.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/bin/libcrypto-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/bin/libcrypto-1_1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/bin/libssl-1_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/bin/libssl-1_1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/bin/opus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/bin/opus.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/bin/zlib1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/cmake/dpp/dpp-config-version.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "10.1.3") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("10.1.3" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) 21 | string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") 22 | endif() 23 | else() 24 | set(CVF_VERSION_MAJOR "10.1.3") 25 | endif() 26 | 27 | if(PACKAGE_FIND_VERSION_RANGE) 28 | # both endpoints of the range must have the expected major version 29 | math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") 30 | if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 31 | OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) 32 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) 33 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 34 | elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 35 | AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) 36 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) 37 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 38 | else() 39 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 40 | endif() 41 | else() 42 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 43 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 44 | else() 45 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 46 | endif() 47 | 48 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 49 | set(PACKAGE_VERSION_EXACT TRUE) 50 | endif() 51 | endif() 52 | endif() 53 | 54 | 55 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 56 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "") 57 | return() 58 | endif() 59 | 60 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 61 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "") 62 | math(EXPR installedBits " * 8") 63 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 64 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 65 | endif() 66 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/cmake/dpp/dpp-config.cmake: -------------------------------------------------------------------------------- 1 | # dpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/cmake/dpp/dpp-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "dpp::dpp" for configuration "Release" 9 | set_property(TARGET dpp::dpp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(dpp::dpp PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/dpp.dll" 13 | ) 14 | 15 | list(APPEND _cmake_import_check_targets dpp::dpp ) 16 | list(APPEND _cmake_import_check_files_for_dpp::dpp "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" "${_IMPORT_PREFIX}/bin/dpp.dll" ) 17 | 18 | # Commands beyond this point should not need to know the version. 19 | set(CMAKE_IMPORT_FILE_VERSION) 20 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/cmake/dpp/dpp.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) 4 | message(FATAL_ERROR "CMake >= 2.8.12 required") 5 | endif() 6 | if(CMAKE_VERSION VERSION_LESS "2.8.12") 7 | message(FATAL_ERROR "CMake >= 2.8.12 required") 8 | endif() 9 | cmake_policy(PUSH) 10 | cmake_policy(VERSION 2.8.12...3.29) 11 | #---------------------------------------------------------------- 12 | # Generated CMake target import file. 13 | #---------------------------------------------------------------- 14 | 15 | # Commands may need to know the format version. 16 | set(CMAKE_IMPORT_FILE_VERSION 1) 17 | 18 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 19 | set(_cmake_targets_defined "") 20 | set(_cmake_targets_not_defined "") 21 | set(_cmake_expected_targets "") 22 | foreach(_cmake_expected_target IN ITEMS dpp::dpp) 23 | list(APPEND _cmake_expected_targets "${_cmake_expected_target}") 24 | if(TARGET "${_cmake_expected_target}") 25 | list(APPEND _cmake_targets_defined "${_cmake_expected_target}") 26 | else() 27 | list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") 28 | endif() 29 | endforeach() 30 | unset(_cmake_expected_target) 31 | if(_cmake_targets_defined STREQUAL _cmake_expected_targets) 32 | unset(_cmake_targets_defined) 33 | unset(_cmake_targets_not_defined) 34 | unset(_cmake_expected_targets) 35 | unset(CMAKE_IMPORT_FILE_VERSION) 36 | cmake_policy(POP) 37 | return() 38 | endif() 39 | if(NOT _cmake_targets_defined STREQUAL "") 40 | string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") 41 | string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") 42 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") 43 | endif() 44 | unset(_cmake_targets_defined) 45 | unset(_cmake_targets_not_defined) 46 | unset(_cmake_expected_targets) 47 | 48 | 49 | # Compute the installation prefix relative to this file. 50 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 52 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 53 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 54 | if(_IMPORT_PREFIX STREQUAL "/") 55 | set(_IMPORT_PREFIX "") 56 | endif() 57 | 58 | # Create imported target dpp::dpp 59 | add_library(dpp::dpp SHARED IMPORTED) 60 | 61 | set_target_properties(dpp::dpp PROPERTIES 62 | INTERFACE_COMPILE_FEATURES "cxx_std_17;cxx_std_20" 63 | INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/dpp-10.1" 64 | INTERFACE_LINK_LIBRARIES "D:/a/DPP/DPP/main/win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib;D:/a/DPP/DPP/main/win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/32/lib/zlib.lib;D:/a/DPP/DPP/main/win32/32/lib/opus.lib" 65 | ) 66 | 67 | # Load information for each installed configuration. 68 | file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dpp-*.cmake") 69 | foreach(_cmake_config_file IN LISTS _cmake_config_files) 70 | include("${_cmake_config_file}") 71 | endforeach() 72 | unset(_cmake_config_file) 73 | unset(_cmake_config_files) 74 | 75 | # Cleanup temporary variables. 76 | set(_IMPORT_PREFIX) 77 | 78 | # Loop over all imported files and verify that they actually exist 79 | foreach(_cmake_target IN LISTS _cmake_import_check_targets) 80 | if(CMAKE_VERSION VERSION_LESS "3.28" 81 | OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} 82 | OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") 83 | foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") 84 | if(NOT EXISTS "${_cmake_file}") 85 | message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file 86 | \"${_cmake_file}\" 87 | but this file does not exist. Possible reasons include: 88 | * The file was deleted, renamed, or moved to another location. 89 | * An install or uninstall procedure did not complete successfully. 90 | * The installation package was faulty and contained 91 | \"${CMAKE_CURRENT_LIST_FILE}\" 92 | but not all the files it references. 93 | ") 94 | endif() 95 | endforeach() 96 | endif() 97 | unset(_cmake_file) 98 | unset("_cmake_import_check_files_for_${_cmake_target}") 99 | endforeach() 100 | unset(_cmake_target) 101 | unset(_cmake_import_check_targets) 102 | 103 | # This file does not depend on other imported targets which have 104 | # been exported from the same project but in a separate export set. 105 | 106 | # Commands beyond this point should not need to know the version. 107 | set(CMAKE_IMPORT_FILE_VERSION) 108 | cmake_policy(POP) 109 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/cmake/dpp/libdpp-config.cmake: -------------------------------------------------------------------------------- 1 | # libdpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/32/release/lib/dpp-10.1/dpp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/32/release/lib/dpp-10.1/dpp.lib -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/bin/dpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/bin/dpp.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/bin/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/bin/libcrypto-1_1-x64.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/bin/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/bin/libssl-1_1-x64.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/bin/opus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/bin/opus.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/bin/zlib1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/cmake/dpp/dpp-config-version.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "10.1.3") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("10.1.3" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) 21 | string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") 22 | endif() 23 | else() 24 | set(CVF_VERSION_MAJOR "10.1.3") 25 | endif() 26 | 27 | if(PACKAGE_FIND_VERSION_RANGE) 28 | # both endpoints of the range must have the expected major version 29 | math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") 30 | if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 31 | OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) 32 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) 33 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 34 | elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 35 | AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) 36 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) 37 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 38 | else() 39 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 40 | endif() 41 | else() 42 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 43 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 44 | else() 45 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 46 | endif() 47 | 48 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 49 | set(PACKAGE_VERSION_EXACT TRUE) 50 | endif() 51 | endif() 52 | endif() 53 | 54 | 55 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 56 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") 57 | return() 58 | endif() 59 | 60 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 61 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") 62 | math(EXPR installedBits "8 * 8") 63 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 64 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 65 | endif() 66 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/cmake/dpp/dpp-config.cmake: -------------------------------------------------------------------------------- 1 | # dpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/cmake/dpp/dpp-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "dpp::dpp" for configuration "Release" 9 | set_property(TARGET dpp::dpp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(dpp::dpp PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/dpp.dll" 13 | ) 14 | 15 | list(APPEND _cmake_import_check_targets dpp::dpp ) 16 | list(APPEND _cmake_import_check_files_for_dpp::dpp "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" "${_IMPORT_PREFIX}/bin/dpp.dll" ) 17 | 18 | # Commands beyond this point should not need to know the version. 19 | set(CMAKE_IMPORT_FILE_VERSION) 20 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/cmake/dpp/dpp.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) 4 | message(FATAL_ERROR "CMake >= 2.8.12 required") 5 | endif() 6 | if(CMAKE_VERSION VERSION_LESS "2.8.12") 7 | message(FATAL_ERROR "CMake >= 2.8.12 required") 8 | endif() 9 | cmake_policy(PUSH) 10 | cmake_policy(VERSION 2.8.12...3.29) 11 | #---------------------------------------------------------------- 12 | # Generated CMake target import file. 13 | #---------------------------------------------------------------- 14 | 15 | # Commands may need to know the format version. 16 | set(CMAKE_IMPORT_FILE_VERSION 1) 17 | 18 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 19 | set(_cmake_targets_defined "") 20 | set(_cmake_targets_not_defined "") 21 | set(_cmake_expected_targets "") 22 | foreach(_cmake_expected_target IN ITEMS dpp::dpp) 23 | list(APPEND _cmake_expected_targets "${_cmake_expected_target}") 24 | if(TARGET "${_cmake_expected_target}") 25 | list(APPEND _cmake_targets_defined "${_cmake_expected_target}") 26 | else() 27 | list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") 28 | endif() 29 | endforeach() 30 | unset(_cmake_expected_target) 31 | if(_cmake_targets_defined STREQUAL _cmake_expected_targets) 32 | unset(_cmake_targets_defined) 33 | unset(_cmake_targets_not_defined) 34 | unset(_cmake_expected_targets) 35 | unset(CMAKE_IMPORT_FILE_VERSION) 36 | cmake_policy(POP) 37 | return() 38 | endif() 39 | if(NOT _cmake_targets_defined STREQUAL "") 40 | string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") 41 | string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") 42 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") 43 | endif() 44 | unset(_cmake_targets_defined) 45 | unset(_cmake_targets_not_defined) 46 | unset(_cmake_expected_targets) 47 | 48 | 49 | # Compute the installation prefix relative to this file. 50 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 52 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 53 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 54 | if(_IMPORT_PREFIX STREQUAL "/") 55 | set(_IMPORT_PREFIX "") 56 | endif() 57 | 58 | # Create imported target dpp::dpp 59 | add_library(dpp::dpp SHARED IMPORTED) 60 | 61 | set_target_properties(dpp::dpp PROPERTIES 62 | INTERFACE_COMPILE_FEATURES "cxx_std_17;cxx_std_20" 63 | INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/dpp-10.1" 64 | INTERFACE_LINK_LIBRARIES "D:/a/DPP/DPP/main/library/../win32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/lib/zlib.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/lib/zlib.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib" 65 | ) 66 | 67 | # Load information for each installed configuration. 68 | file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dpp-*.cmake") 69 | foreach(_cmake_config_file IN LISTS _cmake_config_files) 70 | include("${_cmake_config_file}") 71 | endforeach() 72 | unset(_cmake_config_file) 73 | unset(_cmake_config_files) 74 | 75 | # Cleanup temporary variables. 76 | set(_IMPORT_PREFIX) 77 | 78 | # Loop over all imported files and verify that they actually exist 79 | foreach(_cmake_target IN LISTS _cmake_import_check_targets) 80 | if(CMAKE_VERSION VERSION_LESS "3.28" 81 | OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} 82 | OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") 83 | foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") 84 | if(NOT EXISTS "${_cmake_file}") 85 | message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file 86 | \"${_cmake_file}\" 87 | but this file does not exist. Possible reasons include: 88 | * The file was deleted, renamed, or moved to another location. 89 | * An install or uninstall procedure did not complete successfully. 90 | * The installation package was faulty and contained 91 | \"${CMAKE_CURRENT_LIST_FILE}\" 92 | but not all the files it references. 93 | ") 94 | endif() 95 | endforeach() 96 | endif() 97 | unset(_cmake_file) 98 | unset("_cmake_import_check_files_for_${_cmake_target}") 99 | endforeach() 100 | unset(_cmake_target) 101 | unset(_cmake_import_check_targets) 102 | 103 | # This file does not depend on other imported targets which have 104 | # been exported from the same project but in a separate export set. 105 | 106 | # Commands beyond this point should not need to know the version. 107 | set(CMAKE_IMPORT_FILE_VERSION) 108 | cmake_policy(POP) 109 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/cmake/dpp/libdpp-config.cmake: -------------------------------------------------------------------------------- 1 | # libdpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/debug/lib/dpp-10.1/dpp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/debug/lib/dpp-10.1/dpp.lib -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/bin/dpp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/bin/dpp.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/bin/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/bin/libcrypto-1_1-x64.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/bin/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/bin/libssl-1_1-x64.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/bin/opus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/bin/opus.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/bin/zlib1.dll -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/cmake/dpp/dpp-config-version.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "10.1.3") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("10.1.3" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) 21 | string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") 22 | endif() 23 | else() 24 | set(CVF_VERSION_MAJOR "10.1.3") 25 | endif() 26 | 27 | if(PACKAGE_FIND_VERSION_RANGE) 28 | # both endpoints of the range must have the expected major version 29 | math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") 30 | if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 31 | OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) 32 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) 33 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 34 | elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR 35 | AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) 36 | OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) 37 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 38 | else() 39 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 40 | endif() 41 | else() 42 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 43 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 44 | else() 45 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 46 | endif() 47 | 48 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 49 | set(PACKAGE_VERSION_EXACT TRUE) 50 | endif() 51 | endif() 52 | endif() 53 | 54 | 55 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 56 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") 57 | return() 58 | endif() 59 | 60 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 61 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") 62 | math(EXPR installedBits "8 * 8") 63 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 64 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 65 | endif() 66 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/cmake/dpp/dpp-config.cmake: -------------------------------------------------------------------------------- 1 | # dpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/cmake/dpp/dpp-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "dpp::dpp" for configuration "Release" 9 | set_property(TARGET dpp::dpp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(dpp::dpp PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/dpp.dll" 13 | ) 14 | 15 | list(APPEND _cmake_import_check_targets dpp::dpp ) 16 | list(APPEND _cmake_import_check_files_for_dpp::dpp "${_IMPORT_PREFIX}/lib/dpp-10.1/dpp.lib" "${_IMPORT_PREFIX}/bin/dpp.dll" ) 17 | 18 | # Commands beyond this point should not need to know the version. 19 | set(CMAKE_IMPORT_FILE_VERSION) 20 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/cmake/dpp/dpp.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) 4 | message(FATAL_ERROR "CMake >= 2.8.12 required") 5 | endif() 6 | if(CMAKE_VERSION VERSION_LESS "2.8.12") 7 | message(FATAL_ERROR "CMake >= 2.8.12 required") 8 | endif() 9 | cmake_policy(PUSH) 10 | cmake_policy(VERSION 2.8.12...3.29) 11 | #---------------------------------------------------------------- 12 | # Generated CMake target import file. 13 | #---------------------------------------------------------------- 14 | 15 | # Commands may need to know the format version. 16 | set(CMAKE_IMPORT_FILE_VERSION 1) 17 | 18 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 19 | set(_cmake_targets_defined "") 20 | set(_cmake_targets_not_defined "") 21 | set(_cmake_expected_targets "") 22 | foreach(_cmake_expected_target IN ITEMS dpp::dpp) 23 | list(APPEND _cmake_expected_targets "${_cmake_expected_target}") 24 | if(TARGET "${_cmake_expected_target}") 25 | list(APPEND _cmake_targets_defined "${_cmake_expected_target}") 26 | else() 27 | list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") 28 | endif() 29 | endforeach() 30 | unset(_cmake_expected_target) 31 | if(_cmake_targets_defined STREQUAL _cmake_expected_targets) 32 | unset(_cmake_targets_defined) 33 | unset(_cmake_targets_not_defined) 34 | unset(_cmake_expected_targets) 35 | unset(CMAKE_IMPORT_FILE_VERSION) 36 | cmake_policy(POP) 37 | return() 38 | endif() 39 | if(NOT _cmake_targets_defined STREQUAL "") 40 | string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") 41 | string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") 42 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") 43 | endif() 44 | unset(_cmake_targets_defined) 45 | unset(_cmake_targets_not_defined) 46 | unset(_cmake_expected_targets) 47 | 48 | 49 | # Compute the installation prefix relative to this file. 50 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 52 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 53 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 54 | if(_IMPORT_PREFIX STREQUAL "/") 55 | set(_IMPORT_PREFIX "") 56 | endif() 57 | 58 | # Create imported target dpp::dpp 59 | add_library(dpp::dpp SHARED IMPORTED) 60 | 61 | set_target_properties(dpp::dpp PROPERTIES 62 | INTERFACE_COMPILE_FEATURES "cxx_std_17;cxx_std_20" 63 | INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/dpp-10.1" 64 | INTERFACE_LINK_LIBRARIES "D:/a/DPP/DPP/main/library/../win32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/lib/zlib.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/lib/libssl.lib;D:/a/DPP/DPP/main/library/../win32/lib/libcrypto.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib;D:/a/DPP/DPP/main/library/../win32/lib/zlib.lib;D:/a/DPP/DPP/main/library/../win32/lib/opus.lib" 65 | ) 66 | 67 | # Load information for each installed configuration. 68 | file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/dpp-*.cmake") 69 | foreach(_cmake_config_file IN LISTS _cmake_config_files) 70 | include("${_cmake_config_file}") 71 | endforeach() 72 | unset(_cmake_config_file) 73 | unset(_cmake_config_files) 74 | 75 | # Cleanup temporary variables. 76 | set(_IMPORT_PREFIX) 77 | 78 | # Loop over all imported files and verify that they actually exist 79 | foreach(_cmake_target IN LISTS _cmake_import_check_targets) 80 | if(CMAKE_VERSION VERSION_LESS "3.28" 81 | OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} 82 | OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") 83 | foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") 84 | if(NOT EXISTS "${_cmake_file}") 85 | message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file 86 | \"${_cmake_file}\" 87 | but this file does not exist. Possible reasons include: 88 | * The file was deleted, renamed, or moved to another location. 89 | * An install or uninstall procedure did not complete successfully. 90 | * The installation package was faulty and contained 91 | \"${CMAKE_CURRENT_LIST_FILE}\" 92 | but not all the files it references. 93 | ") 94 | endif() 95 | endforeach() 96 | endif() 97 | unset(_cmake_file) 98 | unset("_cmake_import_check_files_for_${_cmake_target}") 99 | endforeach() 100 | unset(_cmake_target) 101 | unset(_cmake_import_check_targets) 102 | 103 | # This file does not depend on other imported targets which have 104 | # been exported from the same project but in a separate export set. 105 | 106 | # Commands beyond this point should not need to know the version. 107 | set(CMAKE_IMPORT_FILE_VERSION) 108 | cmake_policy(POP) 109 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/cmake/dpp/libdpp-config.cmake: -------------------------------------------------------------------------------- 1 | # libdpp-config.cmake - package configuration file 2 | 3 | ## Get current filesystem path (will a prefixed by where this package was installed) 4 | get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 5 | 6 | ## Use this directory to include dpp which has the rest of the project targets 7 | include(${SELF_DIR}/dpp.cmake) 8 | 9 | ## Set OpenSSl directory for macos. It is also in our main CMakeLists.txt, but this file is independent from that. 10 | if(APPLE) 11 | if(CMAKE_APPLE_SILICON_PROCESSOR) 12 | set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl") 13 | else() 14 | set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") 15 | endif() 16 | find_package(OpenSSL REQUIRED) 17 | endif() 18 | 19 | # Search for libdpp dependencies 20 | include(CMakeFindDependencyMacro) 21 | find_dependency(OpenSSL REQUIRED) 22 | -------------------------------------------------------------------------------- /MyBot/dependencies/64/release/lib/dpp-10.1/dpp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainboxdotcc/windows-bot-template/d3c580827df53854816235bf95eab32be156030e/MyBot/dependencies/64/release/lib/dpp-10.1/dpp.lib -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/ban.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | /** 33 | * @brief The ban class represents a ban on a guild. 34 | * 35 | */ 36 | class DPP_EXPORT ban : public json_interface { 37 | protected: 38 | friend struct json_interface; 39 | 40 | /** Read class values from json object 41 | * @param j A json object to read from 42 | * @return A reference to self 43 | */ 44 | ban& fill_from_json_impl(nlohmann::json* j); 45 | 46 | public: 47 | /** 48 | * @brief The ban reason. 49 | */ 50 | std::string reason; 51 | 52 | /** 53 | * @brief User ID the ban applies to. 54 | */ 55 | snowflake user_id; 56 | 57 | /** Constructor */ 58 | ban(); 59 | 60 | /** Destructor */ 61 | virtual ~ban() = default; 62 | }; 63 | 64 | /** 65 | * @brief A group of bans. The key is the user ID. 66 | */ 67 | typedef std::unordered_map ban_map; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/bignum.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief This contains the OpenSSL structs. It is not public, 32 | * so that the public interface doesn't depend on OpenSSL directly. 33 | */ 34 | struct openssl_bignum; 35 | 36 | /** 37 | * @brief An arbitrary length integer number. 38 | * Officially, the Discord documentation says that permission values can be any arbitrary 39 | * number of digits. At time of writing there are only 50 bits of permissions, but this is 40 | * set to grow larger and potentially past 64 bits. They will continue to send this data 41 | * as a huge single integer at that point, because this is obviously sensible. /s 42 | * 43 | * @note dpp::bignumber uses OpenSSL BN_* under the hood, as we include openssl anyway 44 | * for HTTPS. 45 | */ 46 | class DPP_EXPORT bignumber { 47 | /** 48 | * @brief Internal opaque struct to contain OpenSSL things 49 | */ 50 | std::shared_ptr ssl_bn{nullptr}; 51 | public: 52 | /** 53 | * @brief Construct a new bignumber object 54 | */ 55 | bignumber() = default; 56 | 57 | /** 58 | * @brief Parse a std::string of an arbitrary length number into 59 | * a bignumber. 60 | * @param number_string string representation of a number. The 61 | * number must be an integer, and can be positive or negative. 62 | * @note Prefixing number_string with 0x will parse it as hexadecimal. 63 | * This is not case sensitive. 64 | */ 65 | bignumber(const std::string& number_string); 66 | 67 | /** 68 | * @brief Build a bignumber from a vector of 64 bit values. 69 | * The values are accepted in "reverse order", so the first vector 70 | * entry at index 0 is the leftmost 64 bits of the bignum. 71 | * The vector can be any arbitrary length. 72 | * @param bits Vector of 64 bit values which represent the number 73 | */ 74 | bignumber(std::vector bits); 75 | 76 | /** 77 | * @brief Default destructor 78 | */ 79 | ~bignumber() = default; 80 | 81 | /** 82 | * @brief Get the string representation of the bignumber. 83 | * @param hex If false (the default) the number is returned in 84 | * decimal, else if this parameter is true, it will be returned 85 | * as hex (without leading '0x') 86 | * @return String representation of bignumber 87 | */ 88 | [[nodiscard]] std::string get_number(bool hex = false) const; 89 | 90 | /** 91 | * @brief Get the array of 64 bit values that represents the 92 | * bignumber. This is what we should use to store bignumbers 93 | * in memory, not this bignumber class itself, as the bignumber 94 | * class instantiates OpenSSL structs and takes significantly 95 | * more ram than just a vector. 96 | * @return Vector of 64 bit values representing the bignumber 97 | */ 98 | [[nodiscard]] std::vector get_binary() const; 99 | }; 100 | 101 | } 102 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/coro.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2022 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | 22 | #pragma once 23 | 24 | #include "coro/awaitable.h" 25 | #include "coro/async.h" 26 | #include "coro/coroutine.h" 27 | #include "coro/job.h" 28 | #include "coro/task.h" 29 | #include "coro/when_any.h" 30 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/coro/async.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2022 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace dpp { 28 | 29 | struct async_dummy : awaitable_dummy { 30 | std::shared_ptr dummy_shared_state = nullptr; 31 | }; 32 | 33 | } 34 | 35 | #ifndef DPP_NO_CORO 36 | 37 | #include "coro.h" 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | namespace dpp { 46 | 47 | namespace detail { 48 | 49 | namespace async { 50 | 51 | /** 52 | * @brief Shared state of the async and its callback, to be used across threads. 53 | */ 54 | template 55 | struct callback { 56 | /** 57 | * @brief Promise object to set the result into 58 | */ 59 | std::shared_ptr> promise{nullptr}; 60 | 61 | /** 62 | * @brief Call operator, sets the value in the promise and notifies any awaiter 63 | * 64 | * @param v Callback value 65 | */ 66 | template 67 | void operator()(const U& v) const requires (std::convertible_to) { 68 | promise->set_value(v); 69 | } 70 | 71 | /** 72 | * @brief Call operator, sets the value in the promise and notifies any awaiter 73 | * 74 | * @param v Callback value 75 | */ 76 | template 77 | void operator()(U&& v) const requires (std::convertible_to) { 78 | promise->set_value(std::move(v)); 79 | } 80 | 81 | /** 82 | * @brief Call operator, sets the value in the promise and notifies any awaiter 83 | */ 84 | void operator()() const requires (std::is_void_v) 85 | { 86 | promise->set_value(); 87 | } 88 | }; 89 | 90 | } // namespace async 91 | 92 | } // namespace detail 93 | 94 | struct confirmation_callback_t; 95 | 96 | /** 97 | * @class async async.h coro/async.h 98 | * @brief A co_await-able object handling an API call in parallel with the caller. 99 | * 100 | * This class is the return type of the dpp::cluster::co_* methods, but it can also be created manually to wrap any async call. 101 | * 102 | * @remark - The coroutine may be resumed in another thread, do not rely on thread_local variables. 103 | * @warning - This feature is EXPERIMENTAL. The API may change at any time and there may be bugs. Please report any to GitHub issues or to the D++ Discord server. 104 | * @tparam R The return type of the API call. Defaults to confirmation_callback_t 105 | */ 106 | template 107 | class async : public awaitable { 108 | /** 109 | * @brief Callable object to pass to API calls 110 | */ 111 | detail::async::callback api_callback{}; 112 | 113 | /** 114 | * @brief Internal promise constructor, grabs a promise object for the callback to use 115 | */ 116 | explicit async(std::shared_ptr> &&promise) : awaitable{promise.get()}, api_callback{std::move(promise)} {} 117 | 118 | public: 119 | using awaitable::awaitable; // use awaitable's constructors 120 | using awaitable::operator=; // use async_base's assignment operator 121 | using awaitable::await_ready; // expose await_ready as public 122 | 123 | /** 124 | * @brief The return type of the API call. Defaults to confirmation_callback_t 125 | */ 126 | using result_type = R; 127 | 128 | /** 129 | * @brief Construct an async object wrapping an object method, the call is made immediately by forwarding to std::invoke and can be awaited later to retrieve the result. 130 | * 131 | * @param obj The object to call the method on 132 | * @param fun The method of the object to call. Its last parameter must be a callback taking a parameter of type R 133 | * @param args Parameters to pass to the method, excluding the callback 134 | */ 135 | template 136 | #ifndef _DOXYGEN_ 137 | requires std::invocable> 138 | #endif 139 | explicit async(Obj &&obj, Fun &&fun, Args&&... args) : async{std::make_shared>()} { 140 | std::invoke(std::forward(fun), std::forward(obj), std::forward(args)..., api_callback); 141 | } 142 | 143 | /** 144 | * @brief Construct an async object wrapping an invokeable object, the call is made immediately by forwarding to std::invoke and can be awaited later to retrieve the result. 145 | * 146 | * @param fun The object to call using std::invoke. Its last parameter must be a callable taking a parameter of type R 147 | * @param args Parameters to pass to the object, excluding the callback 148 | */ 149 | template 150 | #ifndef _DOXYGEN_ 151 | requires std::invocable> 152 | #endif 153 | explicit async(Fun &&fun, Args&&... args) : async{std::make_shared>()} { 154 | std::invoke(std::forward(fun), std::forward(args)..., api_callback); 155 | } 156 | 157 | /** 158 | * @brief Copy constructor is disabled. 159 | */ 160 | async(const async&) = delete; 161 | 162 | /** 163 | * @brief Move constructor, moves the awaitable async object 164 | */ 165 | async(async&&) = default; 166 | 167 | /** 168 | * @brief Copy assignment operator is disabled. 169 | */ 170 | async& operator=(const async&) = delete; 171 | 172 | /** 173 | * @brief Move assignment operator, moves the awaitable async object 174 | */ 175 | async& operator=(async&&) = default; 176 | 177 | /** 178 | * @brief Destructor, signals to the callback that the async object is gone and shouldn't be notified of the result 179 | */ 180 | ~async() { 181 | this->abandon(); 182 | } 183 | }; 184 | 185 | DPP_CHECK_ABI_COMPAT(async<>, async_dummy); 186 | 187 | } 188 | 189 | #endif /* DPP_NO_CORO */ 190 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/coro/job.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2022 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #include 24 | 25 | namespace dpp { 26 | 27 | struct job_dummy { 28 | }; 29 | 30 | } 31 | 32 | #ifndef DPP_NO_CORO 33 | 34 | #include "coro.h" 35 | 36 | #include 37 | #include 38 | 39 | namespace dpp { 40 | 41 | /** 42 | * @class job job.h coro/job.h 43 | * @brief Extremely light coroutine object designed to send off a coroutine to execute on its own. 44 | * Can be used in conjunction with coroutine events via @ref dpp::event_router_t::operator()(F&&) "event routers", or on its own. 45 | * 46 | * This object stores no state and is the recommended way to use coroutines if you do not need to co_await the result. 47 | * 48 | * @warning - This feature is EXPERIMENTAL. The API may change at any time and there may be bugs. 49 | * Please report any to GitHub Issues or to our Discord Server. 50 | * @warning - It cannot be co_awaited, which means the second it co_awaits something, the program jumps back to the calling function, which continues executing. 51 | * At this point, if the function returns, every object declared in the function including its parameters are destroyed, which causes @ref lambdas-and-locals "dangling references". 52 | * For this reason, `co_await` will error if any parameters are passed by reference. 53 | * If you must pass a reference, pass it as a pointer or with std::ref, but you must fully understand the reason behind this warning, and what to avoid. 54 | * If you prefer a safer type, use `coroutine` for synchronous execution, or `task` for parallel tasks, and co_await them. 55 | */ 56 | struct job {}; 57 | 58 | namespace detail { 59 | 60 | namespace job { 61 | 62 | #ifdef DPP_CORO_TEST 63 | struct promise{}; 64 | #endif 65 | 66 | /** 67 | * @brief Coroutine promise type for a job 68 | */ 69 | template 70 | struct promise { 71 | 72 | #ifdef DPP_CORO_TEST 73 | promise() { 74 | ++coro_alloc_count; 75 | } 76 | 77 | ~promise() { 78 | --coro_alloc_count; 79 | } 80 | #endif 81 | 82 | /** 83 | * @brief Function called when the job is done. 84 | * 85 | * @return std::suspend_never Do not suspend at the end, destroying the handle immediately 86 | */ 87 | std_coroutine::suspend_never final_suspend() const noexcept { 88 | return {}; 89 | } 90 | 91 | /** 92 | * @brief Function called when the job is started. 93 | * 94 | * @return std::suspend_never Do not suspend at the start, starting the job immediately 95 | */ 96 | std_coroutine::suspend_never initial_suspend() const noexcept { 97 | return {}; 98 | } 99 | 100 | /** 101 | * @brief Function called to get the job object 102 | * 103 | * @return job 104 | */ 105 | dpp::job get_return_object() const noexcept { 106 | return {}; 107 | } 108 | 109 | /** 110 | * @brief Function called when an exception is thrown and not caught. 111 | * 112 | * @throw Immediately rethrows the exception to the caller / resumer 113 | */ 114 | void unhandled_exception() const { 115 | throw; 116 | } 117 | 118 | /** 119 | * @brief Function called when the job returns. Does nothing. 120 | */ 121 | void return_void() const noexcept {} 122 | }; 123 | 124 | } // namespace job 125 | 126 | } // namespace detail 127 | 128 | DPP_CHECK_ABI_COMPAT(job, job_dummy) 129 | } // namespace dpp 130 | 131 | /** 132 | * @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise type from a coroutine function. 133 | */ 134 | template 135 | struct dpp::detail::std_coroutine::coroutine_traits { 136 | /** 137 | * @brief Promise type for this coroutine signature. 138 | * 139 | * When the coroutine is created from a lambda, that lambda is passed as a first parameter. 140 | * Not ideal but we'll allow any callable that takes the rest of the arguments passed 141 | */ 142 | using promise_type = dpp::detail::job::promise; 143 | }; 144 | 145 | #endif /* DPP_NO_CORO */ 146 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/discord_webhook_server.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief Creates a HTTP server which listens for incoming 32 | * Discord interactions, and if verified as valid, raises them 33 | * as cluster events, returning the response back. 34 | * Note that Discord requires all interaction endpoints to 35 | * have a valid SSL certificate (not self signed) so in most 36 | * cases you should put this port behind a reverse proxy, e.g. 37 | * nginx, apache, etc. 38 | */ 39 | struct discord_webhook_server : public http_server { 40 | 41 | /** 42 | * @brief Verifier for signed requests 43 | */ 44 | signature_verifier verifier; 45 | 46 | /** 47 | * @brief Public key from application dashboard 48 | */ 49 | std::string public_key_hex; 50 | 51 | /** 52 | * @brief Constructor for creation of a HTTP(S) server 53 | * @param creator Cluster creator 54 | * @param discord_public_key Public key for the application from the application dashboard page 55 | * @param address address to bind to, use "0.0.0.0" to bind to all local addresses 56 | * @param port port to bind to. You should generally use a port > 1024. 57 | * @param ssl_private_key Private key PEM file for HTTPS/SSL. If empty, a plaintext server is created 58 | * @param ssl_public_key Public key PEM file for HTTPS/SSL. If empty, a plaintext server is created 59 | */ 60 | discord_webhook_server(cluster* creator, const std::string& discord_public_key, const std::string_view address, uint16_t port, const std::string& ssl_private_key = "", const std::string& ssl_public_key = ""); 61 | 62 | /** 63 | * @brief Handle Discord outbound webhook 64 | * @param request Request from discord 65 | */ 66 | void handle_request(http_server_request* request); 67 | 68 | /** 69 | * @brief Virtual dtor 70 | */ 71 | virtual ~discord_webhook_server() = default; 72 | }; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/dns.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | #include 23 | #ifdef _WIN32 24 | #include 25 | #include 26 | #else 27 | #include 28 | #include 29 | #include 30 | #endif 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | namespace dpp { 39 | 40 | /** 41 | * @brief Represents a cached DNS result. 42 | * Used by the ssl_connection class to store cached copies of dns lookups. 43 | */ 44 | struct DPP_EXPORT dns_cache_entry { 45 | /** 46 | * @brief Resolved address metadata 47 | */ 48 | addrinfo addr; 49 | 50 | /** 51 | * @brief Resolved address as string. 52 | * The metadata is needed to know what type of address it is. 53 | * Do not do silly stuff like just looking to see if '.' is in it! 54 | */ 55 | std::string resolved_addr; 56 | 57 | /** 58 | * @brief Time at which this cache entry is invalidated 59 | */ 60 | time_t expire_timestamp; 61 | 62 | /** 63 | * @brief Get address length 64 | * @return address length 65 | */ 66 | [[nodiscard]] int size() const; 67 | 68 | /** 69 | * @brief Get the address_t that corresponds to this cache entry 70 | * for use when connecting with ::connect() 71 | * @param port Port number to connect to 72 | * @return address_t prefilled with the IP and port number 73 | */ 74 | [[nodiscard]] const address_t get_connecting_address(uint16_t port) const; 75 | 76 | /** 77 | * @brief Allocate a socket file descriptor for the given dns address 78 | * @return File descriptor ready for calling connect(), or INVALID_SOCKET 79 | * on failure. 80 | */ 81 | [[nodiscard]] socket make_connecting_socket() const; 82 | }; 83 | 84 | /** 85 | * @brief Cache container type 86 | */ 87 | using dns_cache_t = std::unordered_map>; 88 | 89 | /** 90 | * @brief Resolve a hostname to an addrinfo 91 | * 92 | * @param hostname Hostname to resolve 93 | * @param port A port number or named service, e.g. "80" 94 | * @return dns_cache_entry* First IP address associated with the hostname DNS record 95 | * @throw dpp::connection_exception On failure to resolve hostname 96 | */ 97 | DPP_EXPORT const dns_cache_entry *resolve_hostname(const std::string &hostname, const std::string &port); 98 | } 99 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/dpp.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/dtemplate.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace dpp { 30 | 31 | /** 32 | * @brief Represents a guild template 33 | */ 34 | class DPP_EXPORT dtemplate : public json_interface { 35 | protected: 36 | friend struct json_interface; 37 | 38 | /** Read class values from json object 39 | * @param j A json object to read from 40 | * @return A reference to self 41 | */ 42 | dtemplate& fill_from_json_impl(nlohmann::json* j); 43 | 44 | /** 45 | * @brief Build the JSON for this object 46 | * 47 | * @param with_id Add ID to output 48 | * @return json JSON content 49 | */ 50 | json to_json_impl(bool with_id = false) const; 51 | 52 | public: 53 | /** 54 | * @brief Template code 55 | */ 56 | std::string code; 57 | 58 | /** 59 | * @brief Template name 60 | */ 61 | std::string name; 62 | 63 | /** 64 | * @brief Template description 65 | */ 66 | std::string description; 67 | 68 | /** 69 | * @brief Usage counter 70 | */ 71 | uint32_t usage_count; 72 | 73 | /** 74 | * @brief User ID of creator 75 | */ 76 | snowflake creator_id; 77 | 78 | /** 79 | * @brief Creation date/time 80 | * 81 | */ 82 | time_t created_at; 83 | 84 | /** 85 | * @brief Last update date/time 86 | */ 87 | time_t updated_at; 88 | 89 | /** 90 | * @brief Guild id the template is created from 91 | */ 92 | snowflake source_guild_id; 93 | 94 | /** 95 | * @brief True if needs synchronising 96 | */ 97 | bool is_dirty; 98 | 99 | /** 100 | * @brief Construct a new dtemplate object 101 | */ 102 | dtemplate(); 103 | 104 | /** 105 | * @brief Destroy the dtemplate object 106 | */ 107 | virtual ~dtemplate() = default; 108 | }; 109 | 110 | /** 111 | * @brief A container of invites 112 | */ 113 | typedef std::unordered_map dtemplate_map; 114 | 115 | } 116 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/event.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | 27 | #define event_decl(x,wstype) /** @brief Internal event handler for wstype websocket events. Called for each websocket message of this type. @internal */ \ 28 | class x : public event { public: virtual void handle(class dpp::discord_client* client, nlohmann::json &j, const std::string &raw); }; 29 | 30 | /** 31 | * @brief The events namespace holds the internal event handlers for each websocket event. 32 | * These are handled internally and also dispatched to the user code if the event is hooked. 33 | */ 34 | namespace dpp::events { 35 | 36 | /** 37 | * @brief An event object represents an event handled internally, passed from the websocket e.g. MESSAGE_CREATE. 38 | */ 39 | class DPP_EXPORT event { 40 | public: 41 | /** 42 | * @brief Pure virtual method for event handler code 43 | * @param client The creating shard 44 | * @param j The json data of the event 45 | * @param raw The raw event json 46 | */ 47 | virtual void handle(class discord_client* client, nlohmann::json &j, const std::string &raw) = 0; 48 | }; 49 | 50 | /* Internal logger */ 51 | event_decl(logger,LOG); 52 | 53 | /* Guilds */ 54 | event_decl(guild_create,GUILD_CREATE); 55 | event_decl(guild_update,GUILD_UPDATE); 56 | event_decl(guild_delete,GUILD_DELETE); 57 | event_decl(guild_ban_add,GUILD_BAN_ADD); 58 | event_decl(guild_ban_remove,GUILD_BAN_REMOVE); 59 | event_decl(guild_emojis_update,GUILD_EMOJIS_UPDATE); 60 | event_decl(guild_integrations_update,GUILD_INTEGRATIONS_UPDATE); 61 | event_decl(guild_join_request_delete,GUILD_JOIN_REQUEST_DELETE); 62 | event_decl(guild_stickers_update,GUILD_STICKERS_UPDATE); 63 | 64 | /* Stage channels */ 65 | event_decl(stage_instance_create,STAGE_INSTANCE_CREATE); 66 | event_decl(stage_instance_update,STAGE_INSTANCE_UPDATE); 67 | event_decl(stage_instance_delete,STAGE_INSTANCE_DELETE); 68 | 69 | /* Guild members */ 70 | event_decl(guild_member_add,GUILD_MEMBER_ADD); 71 | event_decl(guild_member_remove,GUILD_MEMBER_REMOVE); 72 | event_decl(guild_members_chunk,GUILD_MEMBERS_CHUNK); 73 | event_decl(guild_member_update,GUILD_MEMBERS_UPDATE); 74 | 75 | /* Guild roles */ 76 | event_decl(guild_role_create,GUILD_ROLE_CREATE); 77 | event_decl(guild_role_update,GUILD_ROLE_UPDATE); 78 | event_decl(guild_role_delete,GUILD_ROLE_DELETE); 79 | 80 | /* Session state */ 81 | event_decl(resumed,RESUMED); 82 | event_decl(ready,READY); 83 | 84 | /* Channels */ 85 | event_decl(channel_create,CHANNEL_CREATE); 86 | event_decl(channel_update,CHANNEL_UPDATE); 87 | event_decl(channel_delete,CHANNEL_DELETE); 88 | event_decl(channel_pins_update,CHANNEL_PINS_UPDATE); 89 | 90 | /* Threads */ 91 | event_decl(thread_create,THREAD_CREATE); 92 | event_decl(thread_update,THREAD_UPDATE); 93 | event_decl(thread_delete,THREAD_DELETE); 94 | event_decl(thread_list_sync,THREAD_LIST_SYNC); 95 | event_decl(thread_member_update,THREAD_MEMBER_UPDATE); 96 | event_decl(thread_members_update,THREAD_MEMBERS_UPDATE); 97 | 98 | /* Messages */ 99 | event_decl(message_create,MESSAGE_CREATE); 100 | event_decl(message_update,MESSAGE_UPDATE); 101 | event_decl(message_delete,MESSAGE_DELETE); 102 | event_decl(message_delete_bulk,MESSAGE_DELETE_BULK); 103 | event_decl(message_poll_vote_add,MESSAGE_POLL_VOTE_ADD); 104 | event_decl(message_poll_vote_remove,MESSAGE_POLL_VOTE_REMOVE); 105 | 106 | /* Presence/typing */ 107 | event_decl(presence_update,PRESENCE_UPDATE); 108 | event_decl(typing_start,TYPING_START); 109 | 110 | /* Users (outside of guild) */ 111 | event_decl(user_update,USER_UPDATE); 112 | 113 | /* Message reactions */ 114 | event_decl(message_reaction_add,MESSAGE_REACTION_ADD); 115 | event_decl(message_reaction_remove,MESSAGE_REACTION_REMOVE); 116 | event_decl(message_reaction_remove_all,MESSAGE_REACTION_REMOVE_ALL); 117 | event_decl(message_reaction_remove_emoji,MESSAGE_REACTION_REMOVE_EMOJI); 118 | 119 | /* Invites */ 120 | event_decl(invite_create,INVITE_CREATE); 121 | event_decl(invite_delete,INVITE_DELETE); 122 | 123 | /* Voice */ 124 | event_decl(voice_state_update,VOICE_STATE_UPDATE); 125 | event_decl(voice_server_update,VOICE_SERVER_UPDATE); 126 | 127 | /* Webhooks */ 128 | event_decl(webhooks_update,WEBHOOKS_UPDATE); 129 | 130 | /* Application commands */ 131 | event_decl(interaction_create,INTERACTION_CREATE); 132 | 133 | /* Integrations */ 134 | event_decl(integration_create,INTEGRATION_CREATE); 135 | event_decl(integration_update,INTEGRATION_UPDATE); 136 | event_decl(integration_delete,INTEGRATION_DELETE); 137 | 138 | /* Scheduled events */ 139 | event_decl(guild_scheduled_event_create,GUILD_SCHEDULED_EVENT_CREATE); 140 | event_decl(guild_scheduled_event_update,GUILD_SCHEDULED_EVENT_UPDATE); 141 | event_decl(guild_scheduled_event_delete,GUILD_SCHEDULED_EVENT_DELETE); 142 | event_decl(guild_scheduled_event_user_add,GUILD_SCHEDULED_EVENT_USER_ADD); 143 | event_decl(guild_scheduled_event_user_remove,GUILD_SCHEDULED_EVENT_USER_REMOVE); 144 | 145 | /* Auto moderation */ 146 | event_decl(automod_rule_create, AUTO_MODERATION_RULE_CREATE); 147 | event_decl(automod_rule_update, AUTO_MODERATION_RULE_UPDATE); 148 | event_decl(automod_rule_delete, AUTO_MODERATION_RULE_DELETE); 149 | event_decl(automod_rule_execute, AUTO_MODERATION_ACTION_EXECUTION); 150 | 151 | /* Audit log */ 152 | event_decl(guild_audit_log_entry_create, GUILD_AUDIT_LOG_ENTRY_CREATE); 153 | 154 | /* Entitlements */ 155 | event_decl(entitlement_create, ENTITLEMENT_CREATE); 156 | event_decl(entitlement_update, ENTITLEMENT_UPDATE); 157 | event_decl(entitlement_delete, ENTITLEMENT_DELETE); 158 | 159 | } 160 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/export.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | /* Compile-time check for C++17. 24 | * Either one of the following causes a compile time error: 25 | * __cplusplus not defined at all (this means we are being compiled on a C compiler) 26 | * MSVC defined and _MSVC_LANG < 201703L (Visual Studio, but not C++17 or newer) 27 | * MSVC not defined and __cplusplus < 201703L (Non-visual studio, but not C++17 or newer) 28 | * The additional checks are required because MSVC doesn't correctly set __cplusplus to 201703L, 29 | * which is hugely non-standard, but apparently "it broke stuff" so they dont ever change it 30 | * from C++98. Ugh. 31 | */ 32 | #if (!defined(__cplusplus) || (defined(_MSC_VER) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)) || (!defined(_MSC_VER) && __cplusplus < 201703L)) 33 | #error "D++ Requires a C++17 compatible C++ compiler. Please ensure that you have enabled C++17 in your compiler flags." 34 | #endif 35 | 36 | /* If not using c++20, define DPP_CPP17_COMPAT and DPP_NO_CORO if DPP_NO_CORO is not already defined. 37 | */ 38 | #if !(defined(__cplusplus) && __cplusplus >= 202002L) && !(defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) 39 | #define DPP_CPP17_COMPAT 40 | #if !defined(DPP_CORO) || !DPP_CORO // Allow overriding this because why not 41 | #ifndef DPP_NO_CORO 42 | #define DPP_NO_CORO 43 | #endif 44 | #endif 45 | #endif 46 | 47 | #ifndef DPP_STATIC 48 | /* Dynamic linked build as shared object or dll */ 49 | #ifdef DPP_BUILD 50 | /* Building the library */ 51 | #ifdef _WIN32 52 | #include 53 | #define DPP_EXPORT __declspec(dllexport) 54 | #else 55 | #define DPP_EXPORT 56 | #endif 57 | #else 58 | /* Including the library */ 59 | #ifdef _WIN32 60 | #define DPP_EXPORT __declspec(dllimport) 61 | #else 62 | #define DPP_EXPORT 63 | #endif 64 | #endif 65 | #else 66 | /* Static linked build */ 67 | #if defined(_WIN32) && defined(DPP_BUILD) 68 | #include 69 | #endif 70 | #define DPP_EXPORT 71 | #endif 72 | 73 | namespace dpp { 74 | 75 | /** 76 | * @brief Represents a build configuration. On some platforms (e.g. Windows) release isn't compatible with debug, so we use this enum to detect it. 77 | */ 78 | enum class build_type { 79 | /** 80 | * @brief Universal build, works with both debug and release 81 | */ 82 | universal, 83 | 84 | /** 85 | * @brief Debug build 86 | */ 87 | debug, 88 | 89 | /** 90 | * @brief Release build 91 | */ 92 | release 93 | }; 94 | 95 | template 96 | extern bool DPP_EXPORT validate_configuration(); 97 | 98 | #if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_GAME) || defined(UE_EDITOR) || defined(UE_BUILD_SHIPPING_WITH_EDITOR) || defined(UE_BUILD_DOCS) 99 | /* 100 | * We need to tell DPP to NOT do the version checker if something from Unreal Engine is defined. 101 | * We have to do this because UE is causing some weirdness where the version checker is broken and always errors. 102 | * This is really only for DPP-UE. There is no reason to not do the version checker unless you are in Unreal Engine. 103 | */ 104 | #define DPP_BYPASS_VERSION_CHECKING 105 | #endif /* UE */ 106 | 107 | #ifndef DPP_BUILD /* when including dpp */ 108 | /** 109 | * Version checking, making sure the program is in a configuration compatible with DPP's. 110 | * 111 | * Do NOT make these variables constexpr. 112 | * We want them to initialize at runtime so the function can be pulled from the shared library object. 113 | */ 114 | #ifndef DPP_BYPASS_VERSION_CHECKING 115 | #if defined(_WIN32) 116 | #ifdef _DEBUG 117 | inline const bool is_valid_config = validate_configuration(); 118 | #else 119 | inline const bool is_valid_config = validate_configuration(); 120 | #endif /* _DEBUG */ 121 | #else 122 | inline const bool is_valid_config = validate_configuration(); 123 | #endif /* _WIN32 */ 124 | #endif /* !DPP_BYPASS_VERSION_CHECKING */ 125 | #endif /* !DPP_BUILD */ 126 | 127 | } 128 | 129 | #ifdef _WIN32 130 | #ifndef NOMINMAX 131 | #define NOMINMAX 132 | #endif 133 | 134 | #include 135 | #endif 136 | 137 | #ifdef _DOXYGEN_ 138 | /** @brief Macro that expands to [[deprecated(reason)]] when including the library, nothing when building the library */ 139 | #define DPP_DEPRECATED(reason) 140 | #else /* !_DOXYGEN_ */ 141 | #if defined(DPP_BUILD) || defined(DPP_NO_DEPRECATED) 142 | /** @brief Macro that expands to [[deprecated(reason)]] when including the library, nothing when building the library */ 143 | #define DPP_DEPRECATED(reason) 144 | #else 145 | /** @brief Macro that expands to [[deprecated(reason)]] when including the library, nothing when building the library */ 146 | #define DPP_DEPRECATED(reason) [[deprecated(reason)]] 147 | #endif 148 | #endif /* _DOXYGEN_ */ 149 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/http_server.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | /** 33 | * @brief Creates a simple HTTP server which listens on a TCP port for a 34 | * plaintext or SSL incoming request, and passes that request to a callback 35 | * to generate the response. 36 | */ 37 | struct http_server : public socket_listener { 38 | 39 | /** 40 | * @brief Request handler callback to use for all incoming HTTP(S) requests 41 | */ 42 | http_server_request_event request_handler; 43 | 44 | /** 45 | * @brief Port we are listening on 46 | */ 47 | uint16_t bound_port; 48 | 49 | /** 50 | * @brief Constructor for creation of a HTTP(S) server 51 | * @param creator Cluster creator 52 | * @param address address to bind to, use "0.0.0.0" to bind to all local addresses 53 | * @param port port to bind to. You should generally use a port > 1024. 54 | * @param handle_request Callback to call for each pending request 55 | * @param private_key Private key PEM file for HTTPS/SSL. If empty, a plaintext server is created 56 | * @param public_key Public key PEM file for HTTPS/SSL. If empty, a plaintext server is created 57 | */ 58 | http_server(cluster* creator, const std::string_view address, uint16_t port, http_server_request_event handle_request, const std::string& private_key = "", const std::string& public_key = ""); 59 | 60 | /** 61 | * @brief Emplace a new request into the connection pool 62 | * @param newfd file descriptor of new request 63 | */ 64 | void emplace(socket newfd) override; 65 | 66 | /** 67 | * @brief Destructor 68 | */ 69 | virtual ~http_server() { 70 | detail::release_ssl_context(bound_port); 71 | } 72 | }; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/intents.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | namespace dpp { 25 | 26 | /** 27 | * @brief intents are a bitmask of allowed events on your websocket. 28 | * 29 | * Some of these are known as Privileged intents (GUILD_MEMBERS and GUILD_PRESENCES) 30 | * and require verification of a bot over 100 servers by discord via submission of 31 | * your real life ID. 32 | */ 33 | enum intents { 34 | /** 35 | * @brief Intent for receipt of guild information. 36 | */ 37 | i_guilds = (1 << 0), 38 | 39 | /** 40 | * @brief Intent for receipt of guild members. 41 | */ 42 | i_guild_members = (1 << 1), 43 | 44 | /** 45 | * @brief Intent for receipt of guild bans. 46 | */ 47 | i_guild_bans = (1 << 2), 48 | 49 | /** 50 | * @brief Intent for receipt of guild emojis. 51 | */ 52 | i_guild_emojis = (1 << 3), 53 | 54 | /** 55 | * @brief Intent for receipt of guild integrations. 56 | */ 57 | i_guild_integrations = (1 << 4), 58 | 59 | /** 60 | * @brief Intent for receipt of guild webhooks. 61 | */ 62 | i_guild_webhooks = (1 << 5), 63 | 64 | /** 65 | * @brief Intent for receipt of guild invites. 66 | */ 67 | i_guild_invites = (1 << 6), 68 | 69 | /** 70 | * @brief Intent for receipt of guild voice states. 71 | */ 72 | i_guild_voice_states = (1 << 7), 73 | 74 | /** 75 | * @brief Intent for receipt of guild presences. 76 | */ 77 | i_guild_presences = (1 << 8), 78 | 79 | /** 80 | * @brief Intent for receipt of guild messages. 81 | */ 82 | i_guild_messages = (1 << 9), 83 | 84 | /** 85 | * @brief Intent for receipt of guild message reactions. 86 | */ 87 | i_guild_message_reactions = (1 << 10), 88 | 89 | /** 90 | * @brief Intent for receipt of guild message typing notifications. 91 | */ 92 | i_guild_message_typing = (1 << 11), 93 | 94 | /** 95 | * @brief Intent for receipt of direct messages (DMs). 96 | */ 97 | i_direct_messages = (1 << 12), 98 | 99 | /** 100 | * @brief Intent for receipt of direct message reactions. 101 | */ 102 | i_direct_message_reactions = (1 << 13), 103 | 104 | /** 105 | * @brief Intent for receipt of direct message typing notifications. 106 | */ 107 | i_direct_message_typing = (1 << 14), 108 | 109 | /** 110 | * @brief Intent for receipt of message content. 111 | */ 112 | i_message_content = (1 << 15), 113 | 114 | /** 115 | * @brief Scheduled events. 116 | */ 117 | i_guild_scheduled_events = (1 << 16), 118 | 119 | /** 120 | * @brief Auto moderation configuration. 121 | */ 122 | i_auto_moderation_configuration = (1 << 20), 123 | 124 | /** 125 | * @brief Auto moderation configuration. 126 | */ 127 | i_auto_moderation_execution = (1 << 21), 128 | 129 | /** 130 | * @brief Default D++ intents (all non-privileged intents). 131 | */ 132 | i_default_intents = dpp::i_guilds | dpp::i_guild_bans | dpp::i_guild_emojis | dpp::i_guild_integrations | 133 | dpp::i_guild_webhooks | dpp::i_guild_invites | dpp::i_guild_voice_states | 134 | dpp::i_guild_messages | dpp::i_guild_message_reactions | dpp::i_guild_message_typing | 135 | dpp::i_direct_messages | dpp::i_direct_message_typing | dpp::i_direct_message_reactions | 136 | dpp::i_guild_scheduled_events | dpp::i_auto_moderation_configuration | 137 | dpp::i_auto_moderation_execution, 138 | 139 | /** 140 | * @brief Privileged intents requiring ID. 141 | */ 142 | i_privileged_intents = dpp::i_guild_members | dpp::i_guild_presences | dpp::i_message_content, 143 | 144 | /** 145 | * @brief Every single intent (dpp::i_default_intents and dpp::i_privileged_intents). 146 | */ 147 | i_all_intents = dpp::i_default_intents | dpp::i_privileged_intents, 148 | 149 | /** 150 | * @brief Unverified bots default intents. 151 | */ 152 | i_unverified_default_intents = dpp::i_default_intents | dpp::i_message_content 153 | }; 154 | 155 | } 156 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa/avx.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #if defined _MSC_VER || defined __GNUC__ || defined __clang__ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | using avx_float = __m128; 33 | 34 | /** 35 | * @brief A class for audio mixing operations using AVX instructions. 36 | */ 37 | class audio_mixer { 38 | public: 39 | 40 | /** 41 | * @brief The number of 32-bit values per CPU register. 42 | */ 43 | inline static constexpr int32_t byte_blocks_per_register{ 4 }; 44 | 45 | /** 46 | * @brief Collect a single register worth of data from data_in, apply gain and increment, and store the result in data_out. 47 | * This version uses AVX instructions. 48 | * 49 | * @param data_in Pointer to the input array of int32_t values. 50 | * @param data_out Pointer to the output array of int16_t values. 51 | * @param current_gain The gain to be applied to the elements. 52 | * @param increment The increment value to be added to each element. 53 | */ 54 | inline void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) { 55 | avx_float current_samples_new{ _mm_mul_ps(gather_values(data_in), 56 | _mm_add_ps(_mm_set1_ps(current_gain), _mm_mul_ps(_mm_set1_ps(increment), _mm_set_ps(0.0f, 1.0f, 2.0f, 3.0f)))) }; 57 | 58 | current_samples_new = _mm_blendv_ps(_mm_max_ps(current_samples_new, _mm_set1_ps(static_cast(std::numeric_limits::min()))), 59 | _mm_min_ps(current_samples_new, _mm_set1_ps(static_cast(std::numeric_limits::max()))), 60 | _mm_cmp_ps(current_samples_new, _mm_set1_ps(0.0f), _CMP_GE_OQ)); 61 | 62 | store_values(current_samples_new, data_out); 63 | } 64 | 65 | /** 66 | * @brief Combine a register worth of elements from decoded_data and store the result in up_sampled_vector. 67 | * This version uses AVX instructions. 68 | * 69 | * @param up_sampled_vector Pointer to the array of int32_t values. 70 | * @param decoded_data Pointer to the array of int16_t values. 71 | */ 72 | inline void combine_samples(int32_t* up_sampled_vector, const int16_t* decoded_data) { 73 | auto newValues{ _mm_add_ps(gather_values(up_sampled_vector), gather_values(decoded_data)) }; 74 | store_values(newValues, up_sampled_vector); 75 | } 76 | 77 | protected: 78 | /** 79 | * @brief Array for storing the values to be loaded/stored. 80 | */ 81 | alignas(16) float values[byte_blocks_per_register]{}; 82 | 83 | /** 84 | * @brief Stores values from a 128-bit AVX vector to a storage location. 85 | * @tparam value_type The target value type for storage. 86 | * @param values_to_store The 128-bit AVX vector containing values to store. 87 | * @param storage_location Pointer to the storage location. 88 | */ 89 | template inline void store_values(const avx_float& values_to_store, value_type* storage_location) { 90 | _mm_store_ps(values, values_to_store); 91 | for (int64_t x = 0; x < byte_blocks_per_register; ++x) { 92 | storage_location[x] = static_cast(values[x]); 93 | } 94 | } 95 | 96 | /** 97 | * @brief Specialization for gathering non-float values into an AVX register. 98 | * @tparam value_type The type of values being gathered. 99 | * @tparam Indices Parameter pack of indices for gathering values. 100 | * @return An AVX register containing gathered values. 101 | */ 102 | template inline avx_float gather_values(value_type* values_new) { 103 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 104 | values[x] = static_cast(values_new[x]); 105 | } 106 | return _mm_load_ps(values); 107 | } 108 | }; 109 | 110 | } 111 | 112 | #endif -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa/avx2.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #if defined _MSC_VER || defined __GNUC__ || defined __clang__ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | using avx_2_float = __m256; 33 | 34 | /** 35 | * @brief A class for audio mixing operations using AVX2 instructions. 36 | */ 37 | class audio_mixer { 38 | public: 39 | 40 | /** 41 | * @brief The number of 32-bit values per CPU register. 42 | */ 43 | inline static constexpr int32_t byte_blocks_per_register{ 8 }; 44 | 45 | /** 46 | * @brief Collect a single register worth of data from data_in, apply gain and increment, and store the result in data_out. 47 | * This version uses AVX2 instructions. 48 | * 49 | * @param data_in Pointer to the input array of int32_t values. 50 | * @param data_out Pointer to the output array of int16_t values. 51 | * @param current_gain The gain to be applied to the elements. 52 | * @param increment The increment value to be added to each element. 53 | */ 54 | inline void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) { 55 | avx_2_float current_samples_new{ _mm256_mul_ps(gather_values(data_in), 56 | _mm256_add_ps(_mm256_set1_ps(current_gain), 57 | _mm256_mul_ps(_mm256_set1_ps(increment), _mm256_set_ps(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f)))) }; 58 | 59 | current_samples_new = 60 | _mm256_blendv_ps(_mm256_max_ps(current_samples_new, _mm256_set1_ps(static_cast(std::numeric_limits::min()))), 61 | _mm256_min_ps(current_samples_new, _mm256_set1_ps(static_cast(std::numeric_limits::max()))), 62 | _mm256_cmp_ps(current_samples_new, _mm256_set1_ps(0.0f), _CMP_GE_OQ)); 63 | 64 | store_values(current_samples_new, data_out); 65 | } 66 | 67 | /** 68 | * @brief Combine a register worth of elements from decoded_data and store the result in up_sampled_vector. 69 | * This version uses AVX2 instructions. 70 | * 71 | * @param up_sampled_vector Pointer to the array of int32_t values. 72 | * @param decoded_data Pointer to the array of int16_t values. 73 | * @param x Index to select a specific set of elements to combine. 74 | */ 75 | inline void combine_samples(int32_t* up_sampled_vector, const int16_t* decoded_data) { 76 | auto newValues{ _mm256_add_ps(gather_values(up_sampled_vector), gather_values(decoded_data)) }; 77 | store_values(newValues, up_sampled_vector); 78 | } 79 | 80 | protected: 81 | /** 82 | * @brief Array for storing the values to be loaded/stored. 83 | */ 84 | alignas(32) float values[byte_blocks_per_register]{}; 85 | 86 | /** 87 | * @brief Stores values from a 256-bit AVX2 vector to a storage location. 88 | * @tparam value_type The target value type for storage. 89 | * @param values_to_store The 256-bit AVX2 vector containing values to store. 90 | * @param storage_location Pointer to the storage location. 91 | */ 92 | template inline void store_values(const avx_2_float& values_to_store, value_type* storage_location) { 93 | _mm256_store_ps(values, values_to_store); 94 | for (int64_t x = 0; x < byte_blocks_per_register; ++x) { 95 | storage_location[x] = static_cast(values[x]); 96 | } 97 | } 98 | 99 | /** 100 | * @brief Specialization for gathering non-float values into an AVX2 register. 101 | * @tparam value_type The type of values being gathered. 102 | * @tparam Indices Parameter pack of indices for gathering values. 103 | * @return An AVX2 register containing gathered values. 104 | */ 105 | template inline avx_2_float gather_values(value_type* values_new) { 106 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 107 | values[x] = static_cast(values_new[x]); 108 | } 109 | return _mm256_load_ps(values); 110 | } 111 | }; 112 | 113 | } 114 | 115 | #endif -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa/avx512.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #if defined _MSC_VER || defined __GNUC__ || defined __clang__ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | using avx_512_float = __m512; 33 | 34 | /** 35 | * @brief A class for audio mixing operations using AVX512 instructions. 36 | */ 37 | class audio_mixer { 38 | public: 39 | 40 | /** 41 | * @brief The number of 32-bit values per CPU register. 42 | */ 43 | inline static constexpr int32_t byte_blocks_per_register{ 16 }; 44 | 45 | /** 46 | * @brief Collect a single register worth of data from data_in, apply gain and increment, and store the result in data_out. 47 | * This version uses AVX512 instructions. 48 | * 49 | * @param data_in Pointer to the input array of int32_t values. 50 | * @param data_out Pointer to the output array of int16_t values. 51 | * @param current_gain The gain to be applied to the elements. 52 | * @param increment The increment value to be added to each element. 53 | */ 54 | inline void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) { 55 | avx_512_float current_samples_new{ _mm512_mul_ps(gather_values(data_in), 56 | _mm512_add_ps(_mm512_set1_ps(current_gain), 57 | _mm512_mul_ps(_mm512_set1_ps(increment), 58 | _mm512_set_ps(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f)))) }; 59 | 60 | __m512 lower_limit = _mm512_set1_ps(static_cast(std::numeric_limits::min())); 61 | __m512 upper_limit = _mm512_set1_ps(static_cast(std::numeric_limits::max())); 62 | 63 | __mmask16 mask_ge = _mm512_cmp_ps_mask(current_samples_new, _mm512_set1_ps(0.0f), _CMP_GE_OQ); 64 | 65 | current_samples_new = _mm512_mask_max_ps(current_samples_new, mask_ge, current_samples_new, lower_limit); 66 | current_samples_new = _mm512_mask_min_ps(current_samples_new, ~mask_ge, current_samples_new, upper_limit); 67 | 68 | store_values(current_samples_new, data_out); 69 | } 70 | 71 | /** 72 | * @brief Combine a register worth of elements from decoded_data and store the result in up_sampled_vector. 73 | * This version uses AVX512 instructions. 74 | * 75 | * @param up_sampled_vector Pointer to the array of int32_t values. 76 | * @param decoded_data Pointer to the array of int16_t values. 77 | */ 78 | inline void combine_samples(int32_t* up_sampled_vector, const int16_t* decoded_data) { 79 | auto newValues{ _mm512_add_ps(gather_values(up_sampled_vector), gather_values(decoded_data)) }; 80 | store_values(newValues, up_sampled_vector); 81 | } 82 | 83 | protected: 84 | /** 85 | * @brief Array for storing the values to be loaded/stored. 86 | */ 87 | alignas(64) float values[byte_blocks_per_register]{}; 88 | 89 | /** 90 | * @brief Stores values from a 512-bit AVX512 vector to a storage location. 91 | * @tparam value_type The target value type for storage. 92 | * @param values_to_store The 512-bit AVX512 vector containing values to store. 93 | * @param storage_location Pointer to the storage location. 94 | */ 95 | template inline static void store_values(const avx_512_float& values_to_store, value_type* storage_location) { 96 | _mm256_store_ps(values, values_to_store); 97 | for (int64_t x = 0; x < byte_blocks_per_register; ++x) { 98 | storage_location[x] = static_cast(values[x]); 99 | } 100 | } 101 | 102 | /** 103 | * @brief Specialization for gathering non-float values into an AVX512 register. 104 | * @tparam value_type The type of values being gathered. 105 | * @tparam Indices Parameter pack of indices for gathering values. 106 | * @return An AVX512 register containing gathered values. 107 | */ 108 | template inline avx_512_float gather_values(value_type* values_new) { 109 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 110 | values[x] = static_cast(values_new[x]); 111 | } 112 | return _mm512_load_ps(values); 113 | } 114 | }; 115 | 116 | } 117 | 118 | #endif -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa/fallback.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief A class for audio mixing operations using x64 instructions. 32 | */ 33 | class audio_mixer { 34 | public: 35 | /* 36 | * @brief The number of 32-bit values per CPU register. 37 | */ 38 | inline static constexpr int32_t byte_blocks_per_register{ 2 }; 39 | 40 | /** 41 | * @brief Collect a single register worth of data from data_in, apply gain and increment, and store the result in data_out. 42 | * This version uses x64 instructions. 43 | * 44 | * @param data_in Pointer to the input array of int32_t values. 45 | * @param data_out Pointer to the output array of int16_t values. 46 | * @param current_gain The gain to be applied to the elements. 47 | * @param increment The increment value to be added to each element. 48 | */ 49 | inline static void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) { 50 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 51 | auto increment_new = increment * x; 52 | auto current_gain_new = current_gain + increment_new; 53 | auto current_sample_new = data_in[x] * current_gain_new; 54 | if (current_sample_new >= std::numeric_limits::max()) { 55 | current_sample_new = std::numeric_limits::max(); 56 | } 57 | else if (current_sample_new <= std::numeric_limits::min()) { 58 | current_sample_new = std::numeric_limits::min(); 59 | } 60 | data_out[x] = static_cast(current_sample_new); 61 | } 62 | } 63 | 64 | /** 65 | * @brief Combine a register worth of elements from decoded_data and store the result in up_sampled_vector. 66 | * This version uses x64 instructions. 67 | * 68 | * @param up_sampled_vector Pointer to the array of int32_t values. 69 | * @param decoded_data Pointer to the array of int16_t values. 70 | */ 71 | inline static void combine_samples(int32_t* up_sampled_vector, const int16_t* decoded_data) { 72 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 73 | up_sampled_vector[x] += static_cast(decoded_data[x]); 74 | } 75 | 76 | } 77 | }; 78 | 79 | } 80 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa/neon.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #if defined _MSC_VER || defined __GNUC__ || defined __clang__ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | using neon_float = float32x4_t; 33 | 34 | /** 35 | * @brief A class for audio mixing operations using ARM NEON instructions. 36 | */ 37 | class audio_mixer { 38 | public: 39 | 40 | /** 41 | * @brief The number of 32-bit values per CPU register. 42 | */ 43 | inline static constexpr int32_t byte_blocks_per_register{ 4 }; 44 | 45 | /** 46 | * @brief Collect a single register worth of data from data_in, apply gain and increment, and store the result in data_out. 47 | * This version uses ARM NEON instructions. 48 | * 49 | * @param data_in Pointer to the input array of int32_t values. 50 | * @param data_out Pointer to the output array of int16_t values. 51 | * @param current_gain The gain to be applied to the elements. 52 | * @param increment The increment value to be added to each element. 53 | */ 54 | inline void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) { 55 | neon_float gathered_values = gather_values(data_in); 56 | neon_float gain_vector = vdupq_n_f32(current_gain); 57 | static constexpr float data[4] = { 0.0f, 1.0f, 2.0f, 3.0f }; 58 | neon_float floats = vld1q_f32(data); 59 | neon_float increment_vector = vmulq_f32(vdupq_n_f32(increment), floats); 60 | neon_float current_samples_new = vmulq_f32(gathered_values, vaddq_f32(gain_vector, increment_vector)); 61 | 62 | // Clamping the values between int16_t min and max 63 | neon_float min_val = vdupq_n_f32(static_cast(std::numeric_limits::min())); 64 | neon_float max_val = vdupq_n_f32(static_cast(std::numeric_limits::max())); 65 | 66 | current_samples_new = vmaxq_f32(current_samples_new, min_val); 67 | current_samples_new = vminq_f32(current_samples_new, max_val); 68 | 69 | store_values(current_samples_new, data_out); 70 | } 71 | 72 | /** 73 | * @brief Combine a register worth of elements from decoded_data and store the result in up_sampled_vector. 74 | * This version uses ARM NEON instructions. 75 | * 76 | * @param up_sampled_vector Pointer to the array of int32_t values. 77 | * @param decoded_data Pointer to the array of int16_t values. 78 | */ 79 | inline void combine_samples(int32_t* up_sampled_vector, const int16_t* decoded_data) { 80 | neon_float up_sampled = gather_values(up_sampled_vector); 81 | neon_float decoded = gather_values(decoded_data); 82 | neon_float newValues = vaddq_f32(up_sampled, decoded); 83 | store_values(newValues, up_sampled_vector); 84 | } 85 | 86 | protected: 87 | /** 88 | * @brief Array for storing the values to be loaded/stored. 89 | */ 90 | alignas(16) float values[byte_blocks_per_register]{}; 91 | 92 | /** 93 | * @brief Stores values from a 128-bit NEON vector to a storage location. 94 | * @tparam value_type The target value type for storage. 95 | * @param values_to_store The 128-bit NEON vector containing values to store. 96 | * @param storage_location Pointer to the storage location. 97 | */ 98 | template inline void store_values(const neon_float& values_to_store, value_type* storage_location) { 99 | vst1q_f32(values, values_to_store); 100 | for (int64_t x = 0; x < byte_blocks_per_register; ++x) { 101 | storage_location[x] = static_cast(values[x]); 102 | } 103 | } 104 | 105 | /** 106 | * @brief Specialization for gathering non-float values into a NEON register. 107 | * @tparam value_type The type of values being gathered. 108 | * @return A NEON register containing gathered values. 109 | */ 110 | template inline neon_float gather_values(value_type* values_new) { 111 | for (uint64_t x = 0; x < byte_blocks_per_register; ++x) { 112 | values[x] = static_cast(values_new[x]); 113 | } 114 | return vld1q_f32(values); 115 | } 116 | }; 117 | 118 | } // namespace dpp 119 | 120 | #endif -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/isa_detection.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #if AVX_TYPE == 1024 24 | #include "isa/neon.h" 25 | #elif AVX_TYPE == 512 26 | #include "isa/avx512.h" 27 | #elif AVX_TYPE == 2 28 | #include "isa/avx2.h" 29 | #elif AVX_TYPE == 1 30 | #include "isa/avx.h" 31 | #else 32 | #include "isa/fallback.h" 33 | #endif 34 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/json.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #ifdef DPP_USE_EXTERNAL_JSON 23 | #include 24 | #else 25 | #include 26 | #endif 27 | 28 | namespace dpp { 29 | 30 | using json = nlohmann::json; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/json_fwd.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #ifdef DPP_USE_EXTERNAL_JSON 23 | #include 24 | #else 25 | #include 26 | #endif 27 | 28 | namespace dpp { 29 | 30 | using json = nlohmann::json; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/json_interface.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2022 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | 22 | #pragma once 23 | #include 24 | #include 25 | 26 | namespace dpp { 27 | 28 | /** 29 | * @brief Represents an interface for an object that can optionally implement functions 30 | * for converting to and from nlohmann::json. The methods are only present if the actual object 31 | * also has those methods. 32 | * 33 | * @tparam T Type of class that implements the interface 34 | */ 35 | template 36 | struct json_interface { 37 | /** 38 | * @brief Convert object from nlohmann::json 39 | * 40 | * @param j nlohmann::json object 41 | * @return T& Reference to self for fluent calling 42 | */ 43 | template ().fill_from_json_impl(std::declval()))> 44 | T& fill_from_json(nlohmann::json* j) { 45 | return static_cast(this)->fill_from_json_impl(j); 46 | } 47 | 48 | /** 49 | * @brief Convert object to nlohmann::json 50 | * 51 | * @param with_id Whether to include the ID or not 52 | * @note Some fields are conditionally filled, do not rely on all fields being present 53 | * @return json Json built from the structure 54 | */ 55 | template ().to_json_impl(bool{}))> 56 | auto to_json(bool with_id = false) const { 57 | return static_cast(this)->to_json_impl(with_id); 58 | } 59 | 60 | /** 61 | * @brief Convert object to json string 62 | * 63 | * @param with_id Whether to include the ID or not 64 | * @note Some fields are conditionally filled, do not rely on all fields being present 65 | * @return std::string Json built from the structure 66 | */ 67 | template ().to_json_impl(bool{}))> 68 | std::string build_json(bool with_id = false) const { 69 | return to_json(with_id).dump(-1, ' ', false, nlohmann::detail::error_handler_t::replace); 70 | } 71 | }; 72 | 73 | } 74 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/managed.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | 27 | namespace dpp { 28 | 29 | /** @brief The managed class is the base class for various types that can 30 | * be stored in a cache that are identified by a dpp::snowflake id. 31 | */ 32 | class DPP_EXPORT managed { 33 | public: 34 | /** 35 | * @brief Unique ID of object set by Discord. 36 | * This value contains a timestamp, worker ID, internal server ID, and an incrementing value. 37 | * Only the timestamp is relevant to us as useful metadata. 38 | */ 39 | snowflake id = {}; 40 | 41 | /** 42 | * @brief Constructor, initialises id to 0. 43 | */ 44 | managed() = default; 45 | 46 | /** 47 | * @brief Constructor, initialises ID 48 | * @param nid ID to set 49 | */ 50 | managed(const snowflake nid) : id{nid} {} 51 | 52 | /** 53 | * @brief Copy constructor 54 | * @param rhs Object to copy 55 | */ 56 | managed(const managed &rhs) = default; 57 | 58 | /** 59 | * @brief Move constructor 60 | * 61 | * Effectively equivalent to copy constructor 62 | * @param rhs Object to move from 63 | */ 64 | managed(managed &&rhs) = default; 65 | 66 | /** 67 | * @brief Destroy the managed object 68 | */ 69 | virtual ~managed() = default; 70 | 71 | /** 72 | * @brief Copy assignment operator 73 | * @param rhs Object to copy 74 | */ 75 | managed &operator=(const managed& rhs) = default; 76 | 77 | /** 78 | * @brief Move assignment operator 79 | * @param rhs Object to move from 80 | */ 81 | managed &operator=(managed&& rhs) = default; 82 | 83 | /** 84 | * @brief Get the creation time of this object according to Discord. 85 | * 86 | * @return double creation time inferred from the snowflake ID. 87 | * The minimum possible value is the first second of 2015. 88 | */ 89 | constexpr double get_creation_time() const noexcept { 90 | return id.get_creation_time(); 91 | }; 92 | 93 | /** 94 | * @brief Comparison operator for comparing two managed objects by id 95 | * 96 | * @param other Other object to compare against 97 | * @return true objects are the same id 98 | * @return false objects are not the same id 99 | */ 100 | constexpr bool operator==(const managed& other) const noexcept { 101 | return id == other.id; 102 | } 103 | 104 | /** 105 | * @brief Comparison operator for comparing two managed objects by id 106 | * 107 | * @param other Other object to compare against 108 | * @return true objects are not the same id 109 | * @return false objects are the same id 110 | */ 111 | constexpr bool operator!=(const managed& other) const noexcept { 112 | return id != other.id; 113 | } 114 | }; 115 | 116 | } 117 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/misc-enum.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | 27 | namespace dpp { 28 | 29 | /** 30 | * @brief Supported image types for profile pictures and CDN endpoints 31 | */ 32 | enum image_type : uint8_t { 33 | /** 34 | * @brief image/png 35 | */ 36 | i_png, 37 | 38 | /** 39 | * @brief image/jpeg. 40 | */ 41 | i_jpg, 42 | 43 | /** 44 | * @brief image/gif. 45 | */ 46 | i_gif, 47 | 48 | /** 49 | * @brief Webp. 50 | */ 51 | i_webp, 52 | }; 53 | 54 | /** 55 | * @brief Log levels 56 | */ 57 | enum loglevel { 58 | /** 59 | * @brief Trace 60 | */ 61 | ll_trace = 0, 62 | 63 | /** 64 | * @brief Debug 65 | */ 66 | ll_debug, 67 | 68 | /** 69 | * @brief Information 70 | */ 71 | ll_info, 72 | 73 | /** 74 | * @brief Warning 75 | */ 76 | ll_warning, 77 | 78 | /** 79 | * @brief Error 80 | */ 81 | ll_error, 82 | 83 | /** 84 | * @brief Critical 85 | */ 86 | ll_critical 87 | }; 88 | 89 | } 90 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/once.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2022 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | #include 23 | #include 24 | 25 | namespace dpp { 26 | 27 | /** 28 | * @brief Run some code within an if() statement only once. 29 | * 30 | * Use this template like this: 31 | * 32 | * ``` 33 | * if (dpp::run_once()) { 34 | * // Your code here 35 | * } 36 | * ``` 37 | * 38 | * @tparam T any unique 'tag' identifier name 39 | * @return auto a true/false return to say if we should execute or not 40 | */ 41 | template auto run_once() { 42 | static auto called = false; 43 | return !std::exchange(called, true); 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/prune.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief Defines a request to count prunable users, or start a prune operation 32 | */ 33 | struct DPP_EXPORT prune : public json_interface { 34 | protected: 35 | friend struct json_interface; 36 | 37 | /** Fill this object from json. 38 | * @param j JSON object to fill from 39 | * @return A reference to self 40 | */ 41 | prune& fill_from_json_impl(nlohmann::json* j); 42 | 43 | /** Build JSON from this object. 44 | * @param with_prune_count True if the prune count boolean is to be set in the built JSON 45 | * @return The JSON of the prune object 46 | */ 47 | virtual json to_json_impl(bool with_prune_count = false) const; 48 | 49 | public: 50 | /** 51 | * @brief Destroy this prune object 52 | */ 53 | virtual ~prune() = default; 54 | 55 | /** 56 | * @brief Number of days to include in the prune. 57 | */ 58 | uint32_t days = 0; 59 | 60 | /** 61 | * @brief Roles to include in the prune (empty to include everyone). 62 | */ 63 | std::vector include_roles; 64 | 65 | /** 66 | * @brief True if the count of pruneable users should be returned. 67 | * @warning Discord recommend not using this on big guilds. 68 | */ 69 | bool compute_prune_count; 70 | 71 | /** 72 | * @brief Build JSON from this object. 73 | * 74 | * @param with_id True if the prune count boolean is to be set in the built JSON 75 | * @return The JSON of the prune object 76 | */ 77 | json to_json(bool with_id = false) const; // Intentional shadow of json_interface, mostly present for documentation 78 | }; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/signature_verifier.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief Verifies signatures on incoming webhooks using OpenSSL 32 | */ 33 | class signature_verifier { 34 | public: 35 | /** 36 | * @brief Constructor initializes the OpenSSL context and public key buffer 37 | */ 38 | signature_verifier(); 39 | 40 | /** 41 | * @brief Verifies the signature with the provided public key, timestamp, body, and signature 42 | * @param timestamp The timestamp of the request 43 | * @param body The body of the request 44 | * @param signature The hex-encoded signature to verify 45 | * @param public_key_hex The hex-encoded public key 46 | * @return true if the signature is valid, false otherwise 47 | */ 48 | bool verify_signature(const std::string& timestamp, const std::string& body, const std::string& signature, const std::string& public_key_hex); 49 | 50 | }; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/sku.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace dpp { 32 | 33 | /** 34 | * @brief The type of SKU. 35 | * */ 36 | enum sku_type : uint8_t { 37 | /** 38 | * @brief Represents a durable one-time purchase 39 | */ 40 | DURABLE = 2, 41 | /** 42 | * @brief Consumable one-time purchase 43 | */ 44 | CONSUMABLE = 3, 45 | /** 46 | * @brief Represents a recurring subscription 47 | */ 48 | SUBSCRIPTION = 5, 49 | 50 | /** 51 | * @brief System-generated group for each SUBSCRIPTION SKU created 52 | * @warning These are automatically created for each subscription SKU and are not used at this time. Please refrain from using these. 53 | */ 54 | SUBSCRIPTION_GROUP = 6, 55 | }; 56 | 57 | /** 58 | * @brief SKU flags. 59 | */ 60 | enum sku_flags : uint16_t { 61 | /** 62 | * @brief SKU is available for purchase 63 | */ 64 | sku_available = 0b000000000000100, 65 | 66 | /** 67 | * @brief Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server. 68 | */ 69 | sku_guild_subscription = 0b000000010000000, 70 | 71 | /** 72 | * @brief Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server. 73 | */ 74 | sku_user_subscription = 0b000000100000000, 75 | }; 76 | 77 | /** 78 | * @brief A definition of a discord SKU. 79 | */ 80 | class DPP_EXPORT sku : public managed, public json_interface { 81 | protected: 82 | friend struct json_interface; 83 | 84 | /** Read class values from json object 85 | * @param j A json object to read from 86 | * @return A reference to self 87 | */ 88 | sku& fill_from_json_impl(nlohmann::json* j); 89 | 90 | /** 91 | * @brief Build json for this SKU object 92 | * 93 | * @param with_id include the ID in the json 94 | * @return json JSON object 95 | */ 96 | json to_json_impl(bool with_id = false) const; 97 | 98 | public: 99 | /** 100 | * @brief The type of SKU. 101 | */ 102 | sku_type type{sku_type::SUBSCRIPTION}; 103 | 104 | /** 105 | * @brief ID of the parent application 106 | */ 107 | snowflake application_id{0}; 108 | 109 | /** 110 | * @brief Customer-facing name of your premium offering 111 | */ 112 | std::string name{}; 113 | 114 | /** 115 | * @brief System-generated URL slug based on the SKU's name 116 | */ 117 | std::string slug{}; 118 | 119 | /** 120 | * @brief Flags bitmap from dpp::sku_flags 121 | */ 122 | uint16_t flags{0}; 123 | 124 | /** 125 | * @brief Construct a new SKU object 126 | */ 127 | sku() = default; 128 | 129 | /** 130 | * @brief Construct a new SKU object with all data required. 131 | * 132 | * @param id ID of the SKU. 133 | * @param type Type of SKU (sku_type). 134 | * @param application_id ID of the parent application. 135 | * @param name Customer-facing name of your premium offering. 136 | * @param slug System-generated URL slug based on the SKU's name. 137 | * @param flags Flags bitmap from dpp::sku_flags. 138 | * 139 | */ 140 | sku(const snowflake id, const sku_type type, const snowflake application_id, const std::string name, const std::string slug, const uint16_t flags); 141 | 142 | /** 143 | * @brief Get the type of SKU. 144 | * 145 | * @return sku_type SKU type 146 | */ 147 | sku_type get_type() const; 148 | 149 | /** 150 | * @brief Is the SKU available for purchase? 151 | * 152 | * @return true if the SKU can be purchased. 153 | */ 154 | bool is_available() const; 155 | 156 | /** 157 | * @brief Is the SKU a guild subscription? 158 | * 159 | * @return true if the SKU is a guild subscription. 160 | */ 161 | bool is_guild_subscription() const; 162 | 163 | /** 164 | * @brief Is the SKU a user subscription? 165 | * 166 | * @return true if the SKU is a user subscription 167 | */ 168 | bool is_user_subscription() const; 169 | }; 170 | 171 | /** 172 | * @brief Group of SKUs. 173 | */ 174 | typedef std::unordered_map sku_map; 175 | 176 | } 177 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/socket.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | #include 25 | #ifdef _WIN32 26 | #include 27 | #include 28 | #include 29 | #define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout) 30 | #define pollfd WSAPOLLFD 31 | #else 32 | #include 33 | #include 34 | #include 35 | #endif 36 | #include 37 | #include 38 | 39 | 40 | namespace dpp 41 | { 42 | /** 43 | * @brief Represents a socket file descriptor. 44 | * This is used to ensure parity between windows and unix-like systems. 45 | */ 46 | #ifndef _WIN32 47 | using socket = int; 48 | #else 49 | using socket = SOCKET; 50 | #endif 51 | 52 | #ifndef SOCKET_ERROR 53 | /** 54 | * @brief Represents a socket in error state 55 | */ 56 | #define SOCKET_ERROR -1 57 | #endif 58 | 59 | #ifndef INVALID_SOCKET 60 | /** 61 | * @brief Represents a socket which is not yet assigned 62 | */ 63 | #define INVALID_SOCKET ~0 64 | #endif 65 | 66 | /** 67 | * @brief Represents an IPv4 address for use with socket functions such as 68 | * bind(). 69 | * 70 | * Avoids type punning with C style casts from sockaddr_in to sockaddr pointers. 71 | */ 72 | class DPP_EXPORT address_t { 73 | /** 74 | * @brief Internal sockaddr struct 75 | */ 76 | sockaddr socket_addr{}; 77 | 78 | public: 79 | 80 | /** 81 | * @brief Create a new address_t 82 | * @param ip IPv4 address 83 | * @param port Port number 84 | * @note Leave both as defaults to create a default bind-to-any setting 85 | */ 86 | address_t(const std::string_view ip = "0.0.0.0", uint16_t port = 0); 87 | 88 | /** 89 | * @brief Get sockaddr 90 | * @return sockaddr pointer 91 | */ 92 | [[nodiscard]] sockaddr *get_socket_address(); 93 | 94 | /** 95 | * @brief Returns size of sockaddr_in 96 | * @return sockaddr_in size 97 | * @note It is important the size this returns is sizeof(sockaddr_in) not 98 | * sizeof(sockaddr), this is NOT a bug but requirement of C socket functions. 99 | */ 100 | [[nodiscard]] size_t size(); 101 | 102 | /** 103 | * @brief Get the port bound to a file descriptor 104 | * @param fd File descriptor 105 | * @return Port number, or 0 if no port bound 106 | */ 107 | [[nodiscard]] uint16_t get_port(socket fd); 108 | }; 109 | 110 | enum raii_socket_type { 111 | rst_udp, 112 | rst_tcp, 113 | 114 | }; 115 | 116 | /** 117 | * @brief Allocates a dpp::socket, closing it on destruction 118 | */ 119 | struct DPP_EXPORT raii_socket { 120 | /** 121 | * @brief File descriptor 122 | */ 123 | socket fd; 124 | 125 | /** 126 | * @brief Construct a socket. 127 | * Calls socket() and returns a new file descriptor 128 | */ 129 | raii_socket(raii_socket_type type = rst_udp); 130 | 131 | /** 132 | * @brief Convert an established fd to an raii_socket 133 | * @param plain_fd 134 | */ 135 | raii_socket(socket plain_fd); 136 | 137 | /** 138 | * @brief Non-copyable 139 | */ 140 | raii_socket(raii_socket&) = delete; 141 | 142 | /** 143 | * @brief Non-movable 144 | */ 145 | raii_socket(raii_socket&&) = delete; 146 | 147 | /** 148 | * @brief Sets the value of a socket option. 149 | * @tparam T type to set option for 150 | * @param level The level at which to change the socket options 151 | * @param name The option to change the value of 152 | * @param value The value to set 153 | * @return True if set successfully 154 | */ 155 | template bool set_option(int level, int name, T value); 156 | 157 | /** 158 | * @brief Bind socket to IP/port 159 | * @param address address to bind to 160 | * @return true on success 161 | */ 162 | bool bind(address_t address); 163 | 164 | /** 165 | * @brief Listen on previously bound port 166 | * @return true on success 167 | */ 168 | bool listen(); 169 | 170 | /** 171 | * @brief Accept a pending connection on listening socket 172 | * @return new connection file descriptor 173 | */ 174 | socket accept(); 175 | 176 | /** 177 | * @brief Non-copyable 178 | */ 179 | raii_socket operator=(raii_socket&) = delete; 180 | 181 | /** 182 | * @brief Non-movable 183 | */ 184 | raii_socket operator=(raii_socket&&) = delete; 185 | 186 | /** 187 | * @brief Destructor 188 | * Frees the socket by closing it 189 | */ 190 | ~raii_socket(); 191 | }; 192 | 193 | 194 | } 195 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/socket_listener.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace dpp { 35 | 36 | enum socket_listener_type : uint8_t { 37 | li_plaintext, 38 | li_ssl, 39 | }; 40 | 41 | /** 42 | * @brief Listens on a TCP socket for new connections, and whenever a new connection is 43 | * received, accept it and spawn a new connection of type T. 44 | * @tparam T type for socket connection, must be derived from ssl_connection 45 | */ 46 | template>> 47 | struct socket_listener { 48 | /** 49 | * @brief The listening socket for incoming connections 50 | */ 51 | raii_socket fd; 52 | 53 | /** 54 | * @brief Active connections for the server of type T 55 | */ 56 | std::unordered_map> connections; 57 | 58 | /** 59 | * @brief Cluster creator 60 | */ 61 | cluster* creator{nullptr}; 62 | 63 | /** 64 | * @brief True if plain text connections to the server are allowed 65 | */ 66 | bool plaintext{true}; 67 | 68 | /** 69 | * @brief Private key PEM file path, if running an SSL server 70 | */ 71 | std::string private_key_file; 72 | 73 | /** 74 | * @brief Public key PEM file path, if running an SSL server 75 | */ 76 | std::string public_key_file; 77 | 78 | /** 79 | * @brief Event to handle socket removal from the connection map 80 | */ 81 | event_handle close_event; 82 | 83 | /** 84 | * @brief Socket events for listen socket in the socket engine 85 | */ 86 | socket_events events; 87 | 88 | /** 89 | * @brief Create a new socket listener (TCP server) 90 | * @param owner Owning cluster 91 | * @param address IP address to bind the listening socket to, use 0.0.0.0 to bind all interfaces 92 | * @param port Port number to bind the listening socket to 93 | * @param type Type of server, plaintext or SSL 94 | * @param private_key For SSL servers, a path to the PEM private key file 95 | * @param public_key For SSL servers, a path to the PEM public key file 96 | * @throws connection_exception on failure to bind or listen to the port/interface 97 | */ 98 | socket_listener(cluster* owner, const std::string_view address, uint16_t port, socket_listener_type type = li_plaintext, const std::string& private_key = "", const std::string& public_key = "") 99 | : fd(rst_tcp), creator(owner), plaintext(type == li_plaintext), private_key_file(private_key), public_key_file(public_key) 100 | { 101 | fd.set_option(SOL_SOCKET, SO_REUSEADDR, 1); 102 | if (!fd.bind(address_t(address, port))) { 103 | // error 104 | throw dpp::connection_exception("Could not bind to " + std::string(address) + ":" + std::to_string(port)); 105 | } 106 | if (!fd.listen()) { 107 | // error 108 | throw dpp::connection_exception("Could not listen for connections on " + std::string(address) + ":" + std::to_string(port)); 109 | } 110 | events = dpp::socket_events( 111 | fd.fd, 112 | WANT_READ | WANT_ERROR, 113 | [this](socket sfd, const struct socket_events &e) { 114 | handle_accept(sfd, e); 115 | }, 116 | [](socket, const struct socket_events&) { }, 117 | [](socket, const struct socket_events&, int) { } 118 | ); 119 | owner->socketengine->register_socket(events); 120 | 121 | close_event = creator->on_socket_close([this](const socket_close_t& event) { 122 | connections.erase(event.fd); 123 | }); 124 | } 125 | 126 | /** 127 | * @brief Destructor, detaches on_socket_close event 128 | */ 129 | ~socket_listener() { 130 | creator->on_socket_close.detach(close_event); 131 | } 132 | 133 | /** 134 | * @brief Handle a new incoming socket with accept() 135 | * Accepts a new connection, and calls emplace() if valid 136 | * @param sfd File descriptor for listening socket 137 | * @param e socket events for the listening socket 138 | */ 139 | virtual void handle_accept(socket sfd, const struct socket_events &e) { 140 | socket new_fd{fd.accept()}; 141 | if (new_fd >= 0) { 142 | emplace(new_fd); 143 | } 144 | } 145 | 146 | /** 147 | * @brief Emplace a new connection into the connection map for the server. 148 | * This is a factory function which must be implemented by the deriving class 149 | * @param newfd File descriptor for new connection 150 | */ 151 | virtual void emplace(socket newfd) = 0; 152 | }; 153 | 154 | } 155 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/ssl_context.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | 26 | namespace dpp::detail { 27 | 28 | struct wrapped_ssl_ctx; 29 | 30 | /** 31 | * @brief Generate a new wrapped SSL context. 32 | * If an SSL context already exists for the given port number, it will be returned, else a new one will be 33 | * generated and cached. Contexts with port = 0 will be considered client contexts. There can only be one 34 | * client context at a time and it covers all SSL client connections. There can be many SSL server contexts, 35 | * individual ones can be cached per-port, each with their own loaded SSL private and public key PEM certificate. 36 | * 37 | * @param port Port number. Pass zero to create or get the client context. 38 | * @param private_key Private key PEM pathname for server contexts 39 | * @param public_key Public key PEM pathname for server contexts 40 | * @return wrapped SSL context 41 | */ 42 | wrapped_ssl_ctx* generate_ssl_context(uint16_t port = 0, const std::string &private_key = "", const std::string &public_key = ""); 43 | 44 | /** 45 | * @brief Release an SSL context 46 | * @warning Only do this if you are certain no SSL connections remain that use this context. 47 | * As OpenSSL is a C library it is impossible for us to track this on its behalf. Be careful! 48 | * @param port port number to release 49 | */ 50 | void release_ssl_context(uint16_t port = 0); 51 | 52 | }; 53 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/stage_instance.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | /** 33 | * @brief Represents the privacy of a stage instance 34 | */ 35 | enum stage_privacy_level : uint8_t { 36 | /** 37 | * @brief The Stage instance is visible publicly, such as on Stage Discovery. 38 | */ 39 | sp_public = 1, 40 | 41 | /** 42 | * @brief The Stage instance is visible to only guild members. 43 | */ 44 | sp_guild_only = 2 45 | }; 46 | 47 | /** 48 | * @brief A stage instance. 49 | * Stage instances are like a conference facility, with moderators/speakers and listeners. 50 | */ 51 | struct DPP_EXPORT stage_instance : public managed, public json_interface { 52 | protected: 53 | friend struct json_interface; 54 | 55 | /** 56 | * @brief Serialise a stage_instance object rom json 57 | * 58 | * @return stage_instance& a reference to self 59 | */ 60 | stage_instance& fill_from_json_impl(const nlohmann::json* j); 61 | 62 | /** 63 | * @brief Build json for this object 64 | * 65 | * @param with_id include ID 66 | * @return json Json of this object 67 | */ 68 | virtual json to_json_impl(bool with_id = false) const; 69 | 70 | public: 71 | /** 72 | * @brief The guild ID of the associated Stage channel. 73 | */ 74 | snowflake guild_id; 75 | 76 | /** 77 | * @brief The ID of the associated Stage channel. 78 | */ 79 | snowflake channel_id; 80 | 81 | /** 82 | * @brief The topic of the Stage instance (1-120 characters). 83 | */ 84 | std::string topic; 85 | 86 | /** 87 | * @brief The privacy level of the Stage instance. 88 | */ 89 | stage_privacy_level privacy_level; 90 | 91 | /** 92 | * @brief Whether or not Stage Discovery is disabled. 93 | */ 94 | bool discoverable_disabled; 95 | 96 | /** 97 | * @brief Create a stage_instance object 98 | */ 99 | stage_instance(); 100 | 101 | /** 102 | * @brief Destroy the stage_instance object 103 | */ 104 | ~stage_instance() = default; 105 | }; 106 | 107 | /** 108 | * @brief A group of stage instances 109 | */ 110 | typedef std::unordered_map stage_instance_map; 111 | 112 | } 113 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/stringops.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++ - A Lightweight C++ Library for Discord 4 | * 5 | * stringops.h taken from TriviaBot 6 | * 7 | * Copyright 2004 Craig Edwards 8 | * 9 | * Core based on Sporks, the Learning Discord Bot, Craig Edwards (c) 2019. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | ************************************************************************************/ 24 | 25 | #pragma once 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace dpp { 35 | /** 36 | * @brief Convert a string to lowercase using tolower() 37 | * 38 | * @tparam T type of string 39 | * @param s String to lowercase 40 | * @return std::basic_string lowercased string 41 | */ 42 | template std::basic_string lowercase(const std::basic_string& s) 43 | { 44 | std::basic_string s2 = s; 45 | std::transform(s2.begin(), s2.end(), s2.begin(), tolower); 46 | return s2; 47 | } 48 | 49 | /** 50 | * @brief Convert a string to uppercase using toupper() 51 | * 52 | * @tparam T type of string 53 | * @param s String to uppercase 54 | * @return std::basic_string uppercased string 55 | */ 56 | template std::basic_string uppercase(const std::basic_string& s) 57 | { 58 | std::basic_string s2 = s; 59 | std::transform(s2.begin(), s2.end(), s2.begin(), toupper); 60 | return s2; 61 | } 62 | 63 | /** 64 | * @brief trim from end of string (right) 65 | * 66 | * @param s String to trim 67 | * @return std::string trimmed string 68 | */ 69 | inline std::string rtrim(std::string s) 70 | { 71 | s.erase(s.find_last_not_of(" \t\n\r\f\v") + 1); 72 | return s; 73 | } 74 | 75 | /** 76 | * @brief trim from beginning of string (left) 77 | * 78 | * @param s string to trim 79 | * @return std::string trimmed string 80 | */ 81 | inline std::string ltrim(std::string s) 82 | { 83 | s.erase(0, s.find_first_not_of(" \t\n\r\f\v")); 84 | return s; 85 | } 86 | 87 | /** 88 | * @brief Trim from both ends of string (right then left) 89 | * 90 | * @param s string to trim 91 | * @return std::string trimmed string 92 | */ 93 | inline std::string trim(std::string s) 94 | { 95 | return ltrim(rtrim(s)); 96 | } 97 | 98 | /** 99 | * @brief Add commas to a string (or dots) based on current locale server-side 100 | * 101 | * @tparam T type of numeric value 102 | * @param value Value 103 | * @return std::string number with commas added 104 | */ 105 | template std::string comma(T value) 106 | { 107 | std::stringstream ss; 108 | ss.imbue(std::locale("")); 109 | ss << std::fixed << value; 110 | return ss.str(); 111 | } 112 | 113 | /** 114 | * @brief Convert any value from a string to another type using stringstream. 115 | * The optional second parameter indicates the format of the input string, 116 | * e.g. std::dec for decimal, std::hex for hex, std::oct for octal. 117 | * 118 | * @tparam T Type to convert to 119 | * @param s String to convert from 120 | * @param f Numeric base, e.g. `std::dec` or `std::hex` 121 | * @return T Returned numeric value 122 | */ 123 | template T from_string(const std::string &s, std::ios_base & (*f)(std::ios_base&)) 124 | { 125 | T t; 126 | std::istringstream iss(s); 127 | iss >> f, iss >> t; 128 | return t; 129 | } 130 | 131 | /** 132 | * @brief Convert any value from a string to another type using stringstream. 133 | * 134 | * @tparam T Type to convert to 135 | * @param s String to convert from 136 | * @return T Returned numeric value 137 | * 138 | * @note Base 10 for numeric conversions. 139 | */ 140 | template T from_string(const std::string &s) 141 | { 142 | if (s.empty()) { 143 | return static_cast(0); 144 | } 145 | T t; 146 | std::istringstream iss(s); 147 | iss >> t; 148 | return t; 149 | } 150 | 151 | /** 152 | * @brief Specialised conversion of uint64_t from string 153 | * 154 | * @tparam int64_t 155 | * @param s string to convert 156 | * @return uint64_t return value 157 | */ 158 | template uint64_t from_string(const std::string &s) 159 | { 160 | return std::stoull(s, 0, 10); 161 | } 162 | 163 | /** 164 | * @brief Specialised conversion of uint32_t from string 165 | * 166 | * @tparam uint32_t 167 | * @param s string to convert 168 | * @return uint32_t return value 169 | */ 170 | template uint32_t from_string(const std::string &s) 171 | { 172 | return (uint32_t) std::stoul(s, 0, 10); 173 | } 174 | 175 | /** 176 | * @brief Specialised conversion of int from string 177 | * 178 | * @tparam int 179 | * @param s string to convert 180 | * @return int return value 181 | */ 182 | template int from_string(const std::string &s) 183 | { 184 | return std::stoi(s, 0, 10); 185 | } 186 | 187 | /** 188 | * @brief Convert a numeric value to hex 189 | * 190 | * @tparam T numeric type 191 | * @param i numeric value 192 | * @param leading_zeroes set to false if you don't want the leading zeroes in the output 193 | * @return std::string value in hex, the length will be 2* the raw size of the type 194 | */ 195 | template std::string to_hex(T i, bool leading_zeroes = true) 196 | { 197 | char str[26] = { 0 }; 198 | size_t size = sizeof(T) * 2; 199 | std::to_chars(std::begin(str), std::end(str), i, 16); 200 | std::string out{str}; 201 | if (leading_zeroes && out.length() < size) { 202 | out.insert(out.begin(), size - out.length(), '0'); 203 | } 204 | return out; 205 | } 206 | 207 | /** 208 | * @brief Format a numeric type as a string with leading zeroes 209 | * 210 | * @tparam T numeric type 211 | * @param i numeric value 212 | * @param width width of type including the leading zeroes 213 | * @return std::string resultant string with leading zeroes 214 | */ 215 | template std::string leading_zeroes(T i, size_t width) 216 | { 217 | std::stringstream stream; 218 | stream.imbue(std::locale::classic()); 219 | stream << std::setfill('0') << std::setw((int)width) << std::dec << i; 220 | return stream.str(); 221 | } 222 | 223 | } 224 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/sysdep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Discord erlpack - tidied up for D++, Craig Edwards 2021. 3 | * 4 | * MessagePack system dependencies modified for erlpack. 5 | * 6 | * Copyright (C) 2008-2010 FURUHASHI Sadayuki 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | #pragma once 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #if defined(__linux__) 27 | #include 28 | #endif 29 | 30 | #ifdef _WIN32 31 | 32 | #ifdef __cplusplus 33 | /* numeric_limits::min,max */ 34 | #ifdef max 35 | #undef max 36 | #endif 37 | #ifdef min 38 | #undef min 39 | #endif 40 | #endif 41 | 42 | #else 43 | #include /* __BYTE_ORDER */ 44 | #endif 45 | 46 | #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) 47 | #if __BYTE_ORDER == __LITTLE_ENDIAN 48 | #define __LITTLE_ENDIAN__ 49 | #elif __BYTE_ORDER == __BIG_ENDIAN 50 | #define __BIG_ENDIAN__ 51 | #elif _WIN32 52 | #define __LITTLE_ENDIAN__ 53 | #endif 54 | #endif 55 | 56 | 57 | #ifdef __LITTLE_ENDIAN__ 58 | 59 | #ifdef _WIN32 60 | # if defined(ntohs) 61 | # define etf_byte_order_16(x) ntohs(x) 62 | # elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400) 63 | # define etf_byte_order_16(x) ((uint16_t)_byteswap_ushort((unsigned short)x)) 64 | # else 65 | # define etf_byte_order_16(x) ( \ 66 | ((((uint16_t)x) << 8) ) | \ 67 | ((((uint16_t)x) >> 8) ) ) 68 | # endif 69 | #else 70 | # define etf_byte_order_16(x) ntohs(x) 71 | #endif 72 | 73 | #ifdef _WIN32 74 | # if defined(ntohl) 75 | # define etf_byte_order_32(x) ntohl(x) 76 | # elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400) 77 | # define etf_byte_order_32(x) ((uint32_t)_byteswap_ulong((unsigned long)x)) 78 | # else 79 | # define etf_byte_order_32(x) \ 80 | ( ((((uint32_t)x) << 24) ) | \ 81 | ((((uint32_t)x) << 8) & 0x00ff0000U ) | \ 82 | ((((uint32_t)x) >> 8) & 0x0000ff00U ) | \ 83 | ((((uint32_t)x) >> 24) ) ) 84 | # endif 85 | #else 86 | # define etf_byte_order_32(x) ntohl(x) 87 | #endif 88 | 89 | #if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400) 90 | # define etf_byte_order_64(x) (_byteswap_uint64(x)) 91 | #elif defined(bswap_64) 92 | # define etf_byte_order_64(x) bswap_64(x) 93 | #elif defined(__DARWIN_OSSwapInt64) 94 | # define etf_byte_order_64(x) __DARWIN_OSSwapInt64(x) 95 | #elif defined(__linux__) 96 | # define etf_byte_order_64(x) be64toh(x) 97 | #else 98 | # define etf_byte_order_64(x) \ 99 | ( ((((uint64_t)x) << 56) ) | \ 100 | ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \ 101 | ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \ 102 | ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \ 103 | ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \ 104 | ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \ 105 | ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \ 106 | ((((uint64_t)x) >> 56) ) ) 107 | #endif 108 | 109 | #else 110 | #define etf_byte_order_16(x) (x) 111 | #define etf_byte_order_32(x) (x) 112 | #define etf_byte_order_64(x) (x) 113 | #endif 114 | 115 | #define store_16_bits(to, num) \ 116 | do { uint16_t val = etf_byte_order_16(num); memcpy(to, &val, 2); } while(0) 117 | #define store_32_bits(to, num) \ 118 | do { uint32_t val = etf_byte_order_32(num); memcpy(to, &val, 4); } while(0) 119 | #define store_64_bits(to, num) \ 120 | do { uint64_t val = etf_byte_order_64(num); memcpy(to, &val, 8); } while(0) 121 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/thread_pool.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace dpp { 32 | 33 | /** 34 | * @brief A work unit is a lambda executed in the thread pool 35 | */ 36 | using work_unit = std::function; 37 | 38 | /** 39 | * @brief A task within a thread pool. A simple lambda that accepts no parameters and returns void. 40 | */ 41 | struct DPP_EXPORT thread_pool_task { 42 | /** 43 | * @brief Task priority, lower value is higher priority 44 | */ 45 | int priority; 46 | /** 47 | * @brief Work unit to execute as the task 48 | */ 49 | work_unit function; 50 | }; 51 | 52 | /** 53 | * @brief Compares two thread pool tasks by priority 54 | */ 55 | struct DPP_EXPORT thread_pool_task_comparator { 56 | /** 57 | * @brief Compare two tasks 58 | * @param a first task 59 | * @param b second task 60 | * @return true if a > b 61 | */ 62 | bool operator()(const thread_pool_task &a, const thread_pool_task &b) const { 63 | return a.priority > b.priority; 64 | }; 65 | }; 66 | 67 | /** 68 | * @brief A thread pool contains 1 or more worker threads which accept thread_pool_task lambadas 69 | * into a queue, which is processed in-order by whichever thread is free. 70 | */ 71 | struct DPP_EXPORT thread_pool { 72 | 73 | /** 74 | * @brief Threads that comprise the thread pool 75 | */ 76 | std::vector threads; 77 | 78 | /** 79 | * @brief Priority queue of tasks to be executed 80 | */ 81 | std::priority_queue, thread_pool_task_comparator> tasks; 82 | 83 | /** 84 | * @brief Mutex for accessing the priority queue 85 | */ 86 | std::mutex queue_mutex; 87 | 88 | /** 89 | * @brief Condition variable to notify for new tasks to run 90 | */ 91 | std::condition_variable cv; 92 | 93 | /** 94 | * @brief True if the thread pool is due to stop 95 | */ 96 | bool stop{false}; 97 | 98 | /** 99 | * @brief Create a new priority thread pool 100 | * @param creator creating cluster (for logging) 101 | * @param num_threads number of threads in the pool 102 | */ 103 | explicit thread_pool(class cluster* creator, size_t num_threads = std::thread::hardware_concurrency()); 104 | 105 | /** 106 | * @brief Destroy the thread pool 107 | */ 108 | ~thread_pool(); 109 | 110 | /** 111 | * @brief Enqueue a new task to the thread pool 112 | * @param task task to enqueue 113 | */ 114 | void enqueue(thread_pool_task task); 115 | }; 116 | 117 | } -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/timed_listener.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace dpp { 31 | 32 | /** 33 | * @brief A timed_listener is a way to temporarily attach to an event for a specific timeframe, then detach when complete. 34 | * A lambda may also be optionally called when the timeout is reached. Destructing the timed_listener detaches any attached 35 | * event listeners, and cancels any created timers, but does not call any timeout lambda. 36 | * 37 | * @tparam attached_event Event within cluster to attach to within the cluster::dispatch member (dpp::dispatcher object) 38 | * @tparam listening_function Definition of lambda function that matches up with the attached_event. 39 | */ 40 | template class timed_listener 41 | { 42 | private: 43 | /** 44 | * @brief Owning cluster. 45 | */ 46 | cluster* owner; 47 | 48 | /** 49 | * @brief Duration of listen. 50 | */ 51 | time_t duration; 52 | 53 | /** 54 | * @brief Reference to attached event in cluster. 55 | */ 56 | //event_router_t on_thread_member_update; 57 | attached_event& ev; 58 | 59 | /** 60 | * @brief Timer handle. 61 | */ 62 | timer th; 63 | 64 | /** 65 | * @brief Event handle. 66 | */ 67 | event_handle listener_handle; 68 | 69 | public: 70 | /** 71 | * @brief Construct a new timed listener object 72 | * 73 | * @param cl Owning cluster 74 | * @param _duration Duration of timed event in seconds 75 | * @param event Event to hook, e.g. cluster.on_message_create 76 | * @param on_end An optional void() lambda to trigger when the timed_listener times out. 77 | * Calling the destructor before the timeout is reached does not call this lambda. 78 | * @param listener Lambda to receive events. Type must match up properly with that passed into the 'event' parameter. 79 | */ 80 | timed_listener(cluster* cl, uint64_t _duration, attached_event& event, listening_function listener, timer_callback_t on_end = {}) 81 | : owner(cl), duration(_duration), ev(event) 82 | { 83 | /* Attach event */ 84 | listener_handle = ev(listener); 85 | /* Create timer */ 86 | th = cl->start_timer([this]([[maybe_unused]] dpp::timer timer_handle) { 87 | /* Timer has finished, detach it from event. 88 | * Only allowed to tick once. 89 | */ 90 | ev.detach(listener_handle); 91 | owner->stop_timer(th); 92 | }, duration, on_end); 93 | } 94 | 95 | /** 96 | * @brief Destroy the timed listener object 97 | */ 98 | ~timed_listener() { 99 | /* Stop timer and detach event, but do not call on_end */ 100 | ev.detach(listener_handle); 101 | owner->stop_timer(th); 102 | } 103 | }; 104 | 105 | } 106 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/timer.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace dpp { 35 | 36 | /** 37 | * @brief Represents a timer handle. 38 | * Returned from cluster::start_timer and used by cluster::stop_timer. 39 | * This is obtained from a simple incrementing value, internally. 40 | */ 41 | typedef size_t timer; 42 | 43 | /** 44 | * @brief The type for a timer callback 45 | */ 46 | typedef std::function timer_callback_t; 47 | 48 | /** 49 | * @brief Used internally to store state of active timers 50 | */ 51 | struct DPP_EXPORT timer_t { 52 | /** 53 | * @brief Timer handle 54 | */ 55 | timer handle{0}; 56 | 57 | /** 58 | * @brief Next timer tick as unix epoch 59 | */ 60 | time_t next_tick{0}; 61 | 62 | /** 63 | * @brief Frequency between ticks 64 | */ 65 | uint64_t frequency{0}; 66 | 67 | /** 68 | * @brief Lambda to call on tick 69 | */ 70 | timer_callback_t on_tick{}; 71 | 72 | /** 73 | * @brief Lambda to call on stop (optional) 74 | */ 75 | timer_callback_t on_stop{}; 76 | }; 77 | 78 | /** 79 | * @brief Used to compare two timers next tick times in a priority queue 80 | */ 81 | struct DPP_EXPORT timer_comparator { 82 | /** 83 | * @brief Compare two timers 84 | * @param a first timer 85 | * @param b second timer 86 | * @return returns true if a > b 87 | */ 88 | bool operator()(const timer_t &a, const timer_t &b) const { 89 | return a.next_tick > b.next_tick; 90 | }; 91 | }; 92 | 93 | 94 | /** 95 | * @brief A priority timers, ordered by earliest first so that the head is always the 96 | * soonest to be due. 97 | */ 98 | typedef std::priority_queue, timer_comparator> timer_next_t; 99 | 100 | /** 101 | * @brief A set of deleted timer handles 102 | */ 103 | typedef std::set timers_deleted_t; 104 | 105 | /** 106 | * @brief Trigger a timed event once. 107 | * The provided callback is called only once. 108 | */ 109 | class DPP_EXPORT oneshot_timer 110 | { 111 | private: 112 | /** 113 | * @brief Owning cluster. 114 | */ 115 | class cluster* owner; 116 | 117 | /** 118 | * @brief Timer handle. 119 | */ 120 | timer th; 121 | public: 122 | /** 123 | * @brief Construct a new oneshot timer object 124 | * 125 | * @param cl cluster owner 126 | * @param duration duration before firing 127 | * @param callback callback to call on firing 128 | */ 129 | oneshot_timer(class cluster* cl, uint64_t duration, timer_callback_t callback); 130 | 131 | /** 132 | * @brief Get the handle for the created one-shot timer 133 | * 134 | * @return timer handle for use with stop_timer 135 | */ 136 | timer get_handle(); 137 | 138 | /** 139 | * @brief Cancel the one shot timer immediately. 140 | * Callback function is not called. 141 | */ 142 | void cancel(); 143 | 144 | /** 145 | * @brief Destroy the oneshot timer object 146 | */ 147 | ~oneshot_timer(); 148 | }; 149 | 150 | } 151 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/version.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | #ifndef DPP_VERSION_LONG 25 | #define DPP_VERSION_LONG 0x00100103 26 | #define DPP_VERSION_SHORT 100103 27 | #define DPP_VERSION_TEXT "D++ 10.1.3 (21-Mar-2025)" 28 | 29 | #define DPP_VERSION_MAJOR ((DPP_VERSION_LONG & 0x00ff0000) >> 16) 30 | #define DPP_VERSION_MINOR ((DPP_VERSION_LONG & 0x0000ff00) >> 8) 31 | #define DPP_VERSION_PATCH (DPP_VERSION_LONG & 0x000000ff) 32 | #endif 33 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/voiceregion.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace dpp { 29 | 30 | /** 31 | * @brief Flags related to a voice region 32 | */ 33 | enum voiceregion_flags { 34 | /** 35 | * @brief The closest (optimal) voice region. 36 | */ 37 | v_optimal = 0x00000001, 38 | 39 | /** 40 | * @brief A Deprecated voice region (avoid switching to these). 41 | */ 42 | v_deprecated = 0x00000010, 43 | 44 | /** 45 | * @brief A custom voice region (used for events/etc). 46 | */ 47 | v_custom = 0x00000100 48 | }; 49 | 50 | /** 51 | * @brief Represents a voice region on discord 52 | */ 53 | class DPP_EXPORT voiceregion : public json_interface { 54 | protected: 55 | friend struct json_interface; 56 | 57 | /** 58 | * @brief Fill object properties from JSON 59 | * 60 | * @param j JSON to fill from 61 | * @return voiceregion& Reference to self 62 | */ 63 | voiceregion& fill_from_json_impl(nlohmann::json* j); 64 | 65 | /** 66 | * @brief Build a json for this object 67 | * 68 | * @param with_id Add ID to output 69 | * @return json JSON string 70 | */ 71 | virtual json to_json_impl(bool with_id = false) const; 72 | 73 | public: 74 | /** 75 | * @brief Voice server ID 76 | */ 77 | std::string id; 78 | 79 | /** 80 | * @brief Voice server name 81 | */ 82 | std::string name; 83 | 84 | /** 85 | * @brief Flags bitmap 86 | */ 87 | uint8_t flags; 88 | 89 | /** 90 | * @brief Construct a new voiceregion object 91 | */ 92 | voiceregion(); 93 | 94 | /** 95 | * @brief Destroy the voiceregion object 96 | */ 97 | virtual ~voiceregion() = default; 98 | 99 | /** 100 | * @brief True if is the optimal voice server 101 | * 102 | * @return true if optimal 103 | */ 104 | bool is_optimal() const; 105 | 106 | /** 107 | * @brief True if is a deprecated voice server 108 | * 109 | * @return true if deprecated 110 | */ 111 | bool is_deprecated() const; 112 | 113 | /** 114 | * @brief True if is a custom voice server 115 | * 116 | * @return true if custom 117 | */ 118 | bool is_custom() const; 119 | }; 120 | 121 | /** 122 | * @brief A group of voice regions 123 | */ 124 | typedef std::unordered_map voiceregion_map; 125 | 126 | } 127 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/voicestate.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace dpp { 30 | 31 | /** 32 | * @brief Bit mask flags relating to voice states 33 | */ 34 | enum voicestate_flags { 35 | /** 36 | * @brief Deafened by the server. 37 | */ 38 | vs_deaf = 0b00000001, 39 | 40 | /** 41 | * @brief Muted by the server. 42 | */ 43 | vs_mute = 0b00000010, 44 | 45 | /** 46 | * @brief Locally Muted. 47 | */ 48 | vs_self_mute = 0b00000100, 49 | 50 | /** 51 | * @brief Locally deafened. 52 | */ 53 | vs_self_deaf = 0b00001000, 54 | 55 | /** 56 | * @brief Whether this user is streaming using "Go Live". 57 | */ 58 | vs_self_stream = 0b00010000, 59 | 60 | /** 61 | * @brief Whether this user's camera is enabled. 62 | */ 63 | vs_self_video = 0b00100000, 64 | 65 | /** 66 | * @brief Whether this user's permission to speak is denied. 67 | */ 68 | vs_suppress = 0b01000000 69 | }; 70 | 71 | /** 72 | * @brief Represents the voice state of a user on a guild 73 | * These are stored in the dpp::guild object, and accessible there, 74 | * or via dpp::channel::get_voice_members 75 | */ 76 | class DPP_EXPORT voicestate : public json_interface { 77 | protected: 78 | friend struct json_interface; 79 | 80 | /** 81 | * @brief Fill voicestate object from json data 82 | * 83 | * @param j JSON data to fill from 84 | * @return voicestate& Reference to self 85 | */ 86 | voicestate& fill_from_json_impl(nlohmann::json* j); 87 | 88 | public: 89 | /** 90 | * @brief Owning shard. 91 | */ 92 | class discord_client* shard; 93 | 94 | /** 95 | * @brief Optional: The guild id this voice state is for. 96 | */ 97 | snowflake guild_id{0}; 98 | 99 | /** 100 | * @brief The channel id this user is connected to. 101 | * 102 | * @note This may be empty. 103 | */ 104 | snowflake channel_id{0}; 105 | 106 | /** 107 | * @brief The user id this voice state is for. 108 | */ 109 | snowflake user_id{0}; 110 | 111 | /** 112 | * @brief The session id for this voice state. 113 | */ 114 | std::string session_id; 115 | 116 | /** 117 | * @brief Voice state flags from dpp::voicestate_flags. 118 | */ 119 | uint8_t flags{0}; 120 | 121 | /** 122 | * @brief The time at which the user requested to speak. 123 | * 124 | * @note If the user never requested to speak, this is 0. 125 | */ 126 | time_t request_to_speak{0}; 127 | 128 | /** 129 | * @brief Construct a new voicestate object 130 | */ 131 | voicestate(); 132 | 133 | /** 134 | * @brief Destroy the voicestate object 135 | */ 136 | virtual ~voicestate() = default; 137 | 138 | /** 139 | * @brief Return true if the user is deafened by the server. 140 | */ 141 | bool is_deaf() const; 142 | 143 | /** 144 | * @brief Return true if the user is muted by the server. 145 | */ 146 | bool is_mute() const; 147 | 148 | /** 149 | * @brief Return true if user muted themselves. 150 | */ 151 | bool is_self_mute() const; 152 | 153 | /** 154 | * @brief Return true if user deafened themselves. 155 | */ 156 | bool is_self_deaf() const; 157 | 158 | /** 159 | * @brief Return true if the user is streaming using "Go Live". 160 | */ 161 | bool self_stream() const; 162 | 163 | /** 164 | * @brief Return true if the user's camera is enabled. 165 | */ 166 | bool self_video() const; 167 | 168 | /** 169 | * @brief Return true if user is suppressed. 170 | * 171 | * "HELP HELP I'M BEING SUPPRESSED!" 172 | */ 173 | bool is_suppressed() const; 174 | }; 175 | 176 | /** A container of voicestates */ 177 | typedef std::unordered_map voicestate_map; 178 | 179 | } 180 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/webhook.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace dpp { 35 | 36 | /** 37 | * @brief Defines types of webhook 38 | */ 39 | enum webhook_type { 40 | /** 41 | * @brief Incoming webhook. 42 | */ 43 | w_incoming = 1, 44 | 45 | /** 46 | * @brief Channel following webhook. 47 | */ 48 | w_channel_follower = 2, 49 | 50 | /** 51 | * @brief Application webhooks for interactions. 52 | */ 53 | w_application = 3 54 | }; 55 | 56 | /** 57 | * @brief Represents a discord webhook 58 | */ 59 | class DPP_EXPORT webhook : public managed, public json_interface { 60 | protected: 61 | friend struct json_interface; 62 | 63 | /** 64 | * @brief Fill in object from json data 65 | * 66 | * @param j JSON data 67 | * @return webhook& Reference to self 68 | */ 69 | webhook& fill_from_json_impl(nlohmann::json* j); 70 | 71 | /** 72 | * @brief Build JSON string from object 73 | * 74 | * @param with_id Include the ID of the webhook in the json 75 | * @return std::string JSON encoded object 76 | */ 77 | virtual json to_json_impl(bool with_id = false) const; 78 | 79 | public: 80 | /** 81 | * @brief Type of the webhook from dpp::webhook_type. 82 | */ 83 | uint8_t type; 84 | 85 | /** 86 | * @brief The guild id this webhook is for. 87 | * 88 | * @note This field is optional, and may also be empty. 89 | */ 90 | snowflake guild_id; 91 | 92 | /** 93 | * @brief The channel id this webhook is for. 94 | * 95 | * @note This may be empty. 96 | */ 97 | snowflake channel_id; 98 | 99 | /** 100 | * @brief The user this webhook was created by. 101 | * 102 | * @note This field is optional. 103 | * @warning This is not returned when getting a webhook with its token! 104 | */ 105 | user user_obj; 106 | 107 | /** 108 | * @brief The default name of the webhook. 109 | * 110 | * @note This may be empty. 111 | */ 112 | std::string name; 113 | 114 | /** 115 | * @brief The default avatar of the webhook. 116 | * 117 | * @note This may be empty. 118 | */ 119 | utility::iconhash avatar; 120 | 121 | /** 122 | * @brief The secure token of the webhook (returned for Incoming Webhooks). 123 | * 124 | * @note This field is optional. 125 | */ 126 | std::string token; 127 | 128 | /** 129 | * @brief The bot/OAuth2 application that created this webhook. 130 | * 131 | * @note This may be empty. 132 | */ 133 | snowflake application_id; 134 | 135 | /** 136 | * @brief The guild of the channel that this webhook is following (only for Channel Follower Webhooks). 137 | * 138 | * @warning This will be absent if the webhook creator has since lost access to the guild where the followed channel resides! 139 | */ 140 | guild source_guild; 141 | 142 | /** 143 | * @brief The channel that this webhook is following (only for Channel Follower Webhooks). 144 | * 145 | * @warning This will be absent if the webhook creator has since lost access to the guild where the followed channel resides! 146 | */ 147 | channel source_channel; 148 | 149 | /** 150 | * @brief The url used for executing the webhook (returned by the webhooks OAuth2 flow). 151 | */ 152 | std::string url; 153 | 154 | /** 155 | * @brief base64 encoded image data if uploading a new image. 156 | * 157 | * @warning You should only ever read data from here. If you want to set the data, use dpp::webhook::load_image. 158 | */ 159 | std::string image_data; 160 | 161 | /** 162 | * @brief Construct a new webhook object 163 | */ 164 | webhook(); 165 | 166 | /** 167 | * @brief Construct a new webhook object using the Webhook URL provided by Discord 168 | * 169 | * @param webhook_url a fully qualified web address of an existing webhook 170 | * @throw logic_exception if the webhook url could not be parsed 171 | */ 172 | webhook(const std::string& webhook_url); 173 | 174 | /** 175 | * @brief Construct a new webhook object using the webhook ID and the webhook token 176 | * 177 | * @param webhook_id id taken from a link of an existing webhook 178 | * @param webhook_token token taken from a link of an existing webhook 179 | */ 180 | webhook(const snowflake webhook_id, const std::string& webhook_token); 181 | 182 | /** 183 | * @brief Base64 encode image data and allocate it to image_data 184 | * 185 | * @param image_blob Binary image data 186 | * @param type Image type. It can be one of `i_gif`, `i_jpg` or `i_png`. 187 | * @param is_base64_encoded True if the image data is already base64 encoded 188 | * @return webhook& Reference to self 189 | * @throw dpp::length_exception Image data is larger than the maximum size of 256 kilobytes 190 | */ 191 | webhook& load_image(const std::string &image_blob, const image_type type, bool is_base64_encoded = false); 192 | }; 193 | 194 | /** 195 | * @brief A group of webhooks 196 | */ 197 | typedef std::unordered_map webhook_map; 198 | 199 | } 200 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/win32_safe_warnings.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #pragma once 23 | 24 | /* This file contains pragmas to disable warnings on win32 builds with msvc only. 25 | * It is only included during build of D++ itself, and not when including the headers 26 | * into a user's project. 27 | * 28 | * Before adding a warning here please be ABSOLUTELY SURE it is one we cannot easily fix 29 | * and is to be silenced, thrown into the sarlacc pit to be eaten for 1000 years... 30 | */ 31 | 32 | _Pragma("warning( disable : 4251 )"); // 4251 warns when we export classes or structures with stl member variables 33 | _Pragma("warning( disable : 5105 )"); // 5105 is to do with macro warnings 34 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/wrapped_ssl_ctx.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * SPDX-License-Identifier: Apache-2.0 6 | * Copyright 2021 Craig Edwards and D++ contributors 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | ************************************************************************************/ 22 | #include 23 | #include 24 | #include 25 | #include 26 | #pragma once 27 | 28 | namespace dpp::detail { 29 | 30 | /** 31 | * @brief This class wraps a raw SSL_CTX pointer, managing moving, 32 | * creation, and RAII destruction. 33 | */ 34 | struct wrapped_ssl_ctx { 35 | 36 | /** 37 | * @brief SSL_CTX pointer, raw C pointer nastiness 38 | */ 39 | SSL_CTX *context{nullptr}; 40 | 41 | /** 42 | * @brief Get last SSL error message 43 | * @return SSL error message 44 | */ 45 | std::string get_ssl_error() { 46 | unsigned long error_code = ERR_get_error(); 47 | if (error_code == 0) { 48 | return "No error"; 49 | } 50 | char error_buffer[1024]{0}; 51 | ERR_error_string_n(error_code, error_buffer, sizeof(error_buffer)); 52 | return std::string(error_buffer); 53 | } 54 | 55 | /** 56 | * @brief Create a wrapped SSL context 57 | * @param is_server true to create a server context, false to create a client context 58 | * @throws dpp::connection_exception if context could not be created 59 | */ 60 | explicit wrapped_ssl_ctx(bool is_server = false) : context(SSL_CTX_new(is_server ? TLS_server_method() : TLS_client_method())) { 61 | if (context == nullptr) { 62 | throw dpp::connection_exception(err_ssl_context, "Failed to create SSL client context: " + get_ssl_error()); 63 | } 64 | } 65 | 66 | /** 67 | * @brief Copy constructor 68 | * @note Intentionally deleted 69 | */ 70 | wrapped_ssl_ctx(const wrapped_ssl_ctx&) = delete; 71 | 72 | /** 73 | * @brief Copy assignment operator 74 | * @note Intentionally deleted 75 | */ 76 | wrapped_ssl_ctx& operator=(const wrapped_ssl_ctx&) = delete; 77 | 78 | /** 79 | * @brief Move constructor 80 | * @param other source context 81 | */ 82 | wrapped_ssl_ctx(wrapped_ssl_ctx&& other) noexcept : context(other.context) { 83 | other.context = nullptr; 84 | } 85 | 86 | /** 87 | * @brief Move assignment operator 88 | * @param other source context 89 | * @return self 90 | */ 91 | wrapped_ssl_ctx& operator=(wrapped_ssl_ctx&& other) noexcept { 92 | if (this != &other) { 93 | /* Free current context if any and transfer ownership */ 94 | SSL_CTX_free(context); 95 | context = other.context; 96 | other.context = nullptr; 97 | } 98 | return *this; 99 | } 100 | 101 | ~wrapped_ssl_ctx() { 102 | SSL_CTX_free(context); 103 | } 104 | }; 105 | 106 | }; 107 | -------------------------------------------------------------------------------- /MyBot/dependencies/include/dpp-10.1/dpp/zlibcontext.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * 3 | * D++, A Lightweight C++ library for Discord 4 | * 5 | * Copyright 2021 Craig Edwards and D++ contributors 6 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ************************************************************************************/ 21 | #pragma once 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /** 29 | * @brief Forward declaration for zlib stream type 30 | */ 31 | typedef struct z_stream_s z_stream; 32 | 33 | namespace dpp { 34 | 35 | /** 36 | * @brief Size of decompression buffer for zlib compressed traffic 37 | */ 38 | constexpr size_t DECOMP_BUFFER_SIZE = 512 * 1024; 39 | 40 | /** 41 | * @brief This is an opaque class containing zlib library specific structures. 42 | * This wraps the C pointers needed for zlib with unique_ptr and gives us a nice 43 | * buffer abstraction so we don't need to wrestle with raw pointers. 44 | */ 45 | class DPP_EXPORT zlibcontext { 46 | public: 47 | /** 48 | * @brief Zlib stream struct. The actual type is defined in zlib.h 49 | * so is only defined in the implementation file. 50 | */ 51 | z_stream* d_stream{}; 52 | 53 | /** 54 | * @brief ZLib decompression buffer. 55 | * This is automatically set to DECOMP_BUFFER_SIZE bytes when 56 | * the class is constructed. 57 | */ 58 | std::vector decomp_buffer{}; 59 | 60 | /** 61 | * @brief Total decompressed received bytes counter 62 | */ 63 | uint64_t decompressed_total{}; 64 | 65 | /** 66 | * @brief Initialise zlib struct via inflateInit() 67 | * and size the buffer 68 | */ 69 | zlibcontext(); 70 | 71 | /** 72 | * @brief Destroy zlib struct via inflateEnd() 73 | */ 74 | ~zlibcontext(); 75 | 76 | /** 77 | * @brief Decompress zlib deflated buffer 78 | * @param buffer input compressed stream 79 | * @param decompressed output decompressed content 80 | * @return an error code on error, or err_no_code_specified (0) on success 81 | */ 82 | exception_error_code decompress(const std::string& buffer, std::string& decompressed); 83 | }; 84 | 85 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # D++ Windows Bot Template 2 | 3 | A [D++](https://github.com/brainboxdotcc/DPP) Discord Bot template for Visual Studio 2022 (x64 and x86, release and debug). This repository is the result of [this tutorial](https://dpp.dev/build-a-discord-bot-windows-visual-studio.html) with additional enhancements for automatic selection of the correct architecture, and copying of the dll files into the correct folders on successful build. 4 | 5 | This template comes packaged with the latest master branch of D++ from the CI. To use this project simply put your code into the `MyBot.cpp` and press F7. You can do much more with this template. 6 | 7 | For support and assistance please join [the official support discord](https://discord.gg/dpp). 8 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Please report security issues using the security policy of the [D++ project](https://github.com/brainboxdotcc/DPP). 4 | -------------------------------------------------------------------------------- /updatedpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # D++ Windows Bot Template 4 | # (C) Craig Edwards 2021 5 | # 6 | # This script is run on a 15 minute cron by a github action. 7 | # It uses the github client with an organisation token to pull the CI artifacts of the 8 | # last successful CI build on master, and then unzip the windows builds. 9 | # Once the windows builds are unzipped, it extracts the include directory from the 64 10 | # bit release build, and the dlls/libs from all 4 builds, placing them in the correct 11 | # locations in this repository. If they have been changed, this triggers a `git commit` 12 | # followed by a `git push`. 13 | # This script assumes `gh` is authenticated with a usable token and `git` has an SSH 14 | # key ready to use for pushing, and that the checked out `main` branch is current. 15 | # It also assumes nobody has renamed the CI jobs or the artifacts they export as these 16 | # names have to be hard coded into the script. 17 | # 18 | echo "Fetching latest DPP" 19 | mkdir temp 20 | cd temp || exit 21 | echo "Download assets from CI..." 22 | gh run list -w "D++ CI" -R "brainboxdotcc/DPP" -L200 | grep $'\t'master$'\t' | grep ^completed | grep -v pull_request | head -n1 23 | gh run download -R "brainboxdotcc/DPP" $(gh run list -w "D++ CI" -R "brainboxdotcc/DPP" -L200 | grep $'\t'master$'\t' | grep ^completed | grep -v pull_request | head -n1 | awk '{ printf $(NF-2) }') 24 | 25 | if [[ ! -d "./libdpp - Windows x64-Release-vs2022" ]] ; then 26 | echo "Download of assets failed (temporary failure) - not emitting a spurious failure, but exiting now." 27 | exit 0; 28 | fi 29 | 30 | echo "Process windows x64 release" 31 | cd "./libdpp - Windows x64-Release-vs2022" && unzip -qq ./*.zip 32 | # header files from first zip 33 | cp -rv ./*/include ../../MyBot/dependencies/ 34 | 35 | # dll files 36 | cp -rv ./*/bin/*.dll ../../MyBot/dependencies/64/release/bin/ 37 | # lib files 38 | cp -rv ./*/lib ../../MyBot/dependencies/64/release/ 39 | cd .. || exit 40 | 41 | echo "Process windows x64 debug" 42 | cd "./libdpp - Windows x64-Debug-vs2022" && unzip -qq ./*.zip 43 | # dll files 44 | cp -rv ./*/bin/*.dll ../../MyBot/dependencies/64/debug/bin/ 45 | # lib files 46 | cp -rv ./*/lib ../../MyBot/dependencies/64/debug/ 47 | cd .. || exit 48 | 49 | echo "Process windows x86 release" 50 | cd "./libdpp - Windows x86-Release-vs2022" && unzip -qq ./*.zip 51 | # dll files 52 | cp -rv ./*/bin/*.dll ../../MyBot/dependencies/32/release/bin/ 53 | # lib files 54 | cp -rv ./*/lib ../../MyBot/dependencies/32/release/ 55 | cd .. || exit 56 | 57 | echo "Process windows x86 debug" 58 | cd "./libdpp - Windows x86-Debug-vs2022" && unzip -qq ./*.zip 59 | # dll files 60 | cp -rv ./*/bin/*.dll ../../MyBot/dependencies/32/debug/bin/ 61 | # lib files 62 | cp -rv ./*/lib ../../MyBot/dependencies/32/debug/ 63 | cd .. || exit 64 | 65 | echo "Converting linefeeds from dos to unix" 66 | # dos2unix 67 | cd .. || exit 68 | cd MyBot/dependencies/include/dpp-10.1/dpp || exit 69 | find . -exec dos2unix {} \; 70 | cd ../../../../.. || exit 71 | find . -name '*.cmake' -exec dos2unix -q {} \; 72 | 73 | echo "Cleaning up..." 74 | rm -rf temp 75 | 76 | echo "Committing..." 77 | git checkout main 78 | git pull 79 | git add -A MyBot/dependencies 80 | git commit -m "auto update to latest DPP master branch" 81 | git push 82 | --------------------------------------------------------------------------------