Skip to content

Commit f077a5b

Browse files
committed
DiscordCoreAPI Release v1.70
-Refactored the "x"-Data data structures as well as created CacheData structures for the ones that are cached. -Updated the CMakeLists.txt files. -Fixed behavior of certain functions while caching is disabled. -Improved the behavior of the ObjectCache's functions. -Removed superfluous operators. -Improved error reporting. -Improved thread simplicity/reduced thread wastage by reusing threads instead of constructing new ones in the ThreadPool and SongAPI classes. -Improved the KeyAccessor and Fnv1a Hash classes. -Removed superfluous typedefs. -Fixing an accidentally replaced system_clock call. -Updating to fix various compiler warnings. -Fixed a BaseSocketAgent indexing issue. -Added an additional option to choose whether or not to cache GuildMembers, separately from Users. -Removed noexcept from many of the functions. -Improved interfaces for "Discord image urls". -Moved a bunch of utilities out into their own headers, to be inlined. -Switched to using the CoRoutine threadpool for launching VoiceConnection threads, instead of launching a new std::jthread for each one.
1 parent dd6abda commit f077a5b

File tree

85 files changed

+7148
-7467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+7148
-7467
lines changed

BuildTools/Classes/Packager/Vcpkg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function sudo(string $command): void
8989

9090
/**
9191
* Check out a repository by tag or branch name to ~/discordcoreapi,
92-
* using the personal access token and username passed in as command line parameters.
92+
* using the personal access token and userName passed in as command line parameters.
9393
*
9494
* @param string $tag Tag to clone
9595
* @return bool false if the repository could not be cloned
@@ -172,7 +172,7 @@ function constructPortAndVersionFile(string $sha512 = "0"): string
172172
"version": ' . json_encode($this->getVersion()) . ',
173173
"description": "A Discord bot library written in C++ using custom asynchronous coroutines.",
174174
"homepage": "https://discordcoreapi.com",
175-
"license": "LGPL-2.1-or-later",
175+
"license": "MIT",
176176
"supports": "(windows & x64 & !xbox) | (linux & x64)",
177177
"dependencies": [
178178
"jsonifier",

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
set(VCPKG_ROOT_DIR "/home/chris/Vcpkg")
2525
set(Opus_DIR "C:/Vcpkg/installed/x64-windows/share/opus") # Set this one to the folder location of the file "OpusConfig.cmake".
2626
set(unofficial-sodium_DIR "C:/Vcpkg/installed/x64-windows/share/unofficial-sodium") # Set this one to the folder location of the file "unofficial-sodiumConfig.cmake".
27-
set(Jsonifier_DIR "C:/Users/Chris/source/repos/Jsonifier/Install/Windows-Debug/share/jsonifier/") # Set this one to the folder location of the file "JsonifierConfig.cmake".
27+
set(Jsonifier_DIR "C:/vcpkg2/installed/x64-windows/share/jsonifier/") # Set this one to the folder location of the file "JsonifierConfig.cmake".
2828
set(OPENSSL_ROOT_DIR "C:/Vcpkg/installed/x64-windows/") # Set this one to the folder location of the include folder and library folders of OpenSSL.
2929

3030
if (EXISTS "${VCPKG_ROOT_DIR}")
31-
set(ENV{VCPKG_INSTALLATION_ROOT "${VCPKG_ROOT_DIR}")
31+
set(ENV{VCPKG_INSTALLATION_ROOT} "${VCPKG_ROOT_DIR}")
3232
endif()
3333

3434
cmake_minimum_required(VERSION 3.20)

Documentation/Doxygen/Documentation-Examples/999-ReadMe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
![Commit Activity](https://img.shields.io/github/commit-activity/y/realtimechris/discordcoreapi?color=green&label=Commits&style=plastic)
55
![Lines of code](https://img.shields.io/tokei/lines/github/realtimechris/discordcoreapi?&style=plastic&label=Lines%20of%20Code)
66

7-
Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in C++, that leverages custom asynchronous [CoRoutines](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/CoRoutine.hpp), as well as a home-brew set of [Https](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/Https.cpp#L375),
8-
[WebSocket](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/WebSocketEntities.cpp#L441), and [Datagram](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/VoiceConnection.cpp#L277) socket clients - all to deliver the utmost performance and efficiency for your bot. It uses roughly 0.1% of an Intel i7 9750h CPU to stream audio in high quality (Opus @ 48Khz, 16-bit) to a single server.
7+
Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in C++, that leverages custom asynchronous [CoRoutines](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/CoRoutine.hpp), as well as a home-brew set of [Https](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/Https.cpp#L367),
8+
[WebSocket](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/WebSocketClient.cpp#L425), and [Datagram](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/VoiceConnection.cpp#L280) socket clients - all to deliver the utmost performance and efficiency for your bot. It uses roughly 0.1% of an Intel i7 9750h CPU to stream audio in high quality (Opus @ 48Khz, 16-bit) to a single server.
99

1010
![imageDiscordCoreAPI](./TheLogo.png "A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.")
1111

@@ -15,7 +15,7 @@ Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in
1515
![CLANG_17](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG_17.yml?color=00ff90&label=CLANG_17)
1616

1717
# Documentation/Examples
18-
[Documentation/Examples](https://discordcoreapi.com/d8/d3d/a08569.html)
18+
\subpage Examples
1919

2020
# Discord Server
2121
[This is a link to the Discord server!](https://discord.gg/adgMqeBuhP)
@@ -26,7 +26,7 @@ Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in
2626
# Features
2727

2828
## Performant
29-
- Thanks to utilizing [Erlang Text Format](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Utilities/Etf.hpp) for websocket transfer, and a pool of [kept-alive HTTPS connections](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Https.hpp#L143) - this library offers the snappiest responses to your interactions and user input.
29+
- Thanks to utilizing [Erlang Text Format](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Utilities/Etf.hpp) for websocket transfer, and a pool of [kept-alive HTTPS connections](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Utilities/HttpsClient.hpp#L212) - this library offers the snappiest responses to your interactions and user input.
3030

3131
## Audio-Bridge
3232
- Connect multiple voice-channels to one-another using the `StreamInfo` member of the `VoiceConnectInitData` structure, with the `VoiceConnection` class.
@@ -38,7 +38,7 @@ Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in
3838
- All of the Discord API endpoints are covered in this library, including voice communication.
3939

4040
## Concurrent Discord API Access
41-
- As a result of using [custom asynchronous coroutines](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/CoRoutine.hpp) along with a [thread pool](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Utilities/ThreadPool.hpp#L146), this library has the ability to make fully asynchronous/concurrent requests to the Discord API.
41+
- As a result of using [custom asynchronous coroutines](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/CoRoutine.hpp) along with a [thread pool](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Include/discordcoreapi/Utilities/CoRoutineThreadPool.hpp#L59), this library has the ability to make fully asynchronous/concurrent requests to the Discord API.
4242

4343
## Advanced Rate-Limiting System
4444
- Guarantees that the order in which HTTPS requests are executed is the same that they were submitted in - despite being launched across different threads, while never infracting on any of the Discord API's rate-limits and while running concurrently across all of the endpoints.
@@ -131,7 +131,7 @@ InputEvents::deleteInputEventResponseAsync(newEvent, 20000).get();
131131
- [Here](https://github.com/RealTimeChris/Bot-Template-for-DiscordCoreAPI/blob/main/CMakeLists.txt) is an example of building an executable from this library with this method.
132132
133133
# Build Instructions (Non-Vcpkg) - The Executable
134-
- Download the [bot template](https://github.com/RealTimeChris/Bot-Template-for-DiscordCoreAPI) or create your own with the same [imports](https://github.com/RealTimeChris/Bot-Template-For-DiscordCoreAPI/blob/main/CMakeLists.txt#L49), and set within it either the `VCPKG_ROOT_DIR`, or the `CMAKE_CONFIG_FILE_DIR`, `Opus_DIR`, and `unofficial-sodium_DIR` paths to wherever each of the respective dependency files are located and they are as follows:
134+
- Download the [bot template](https://github.com/RealTimeChris/Bot-Template-for-DiscordCoreAPI) or create your own with the same [imports](https://github.com/RealTimeChris/Bot-Template-For-DiscordCoreAPI/blob/main/CMakeLists.txt#L10), and set within it either the `VCPKG_ROOT_DIR`, or the `CMAKE_CONFIG_FILE_DIR`, `Opus_DIR`, and `unofficial-sodium_DIR` paths to wherever each of the respective dependency files are located and they are as follows:
135135
- CMAKE_CONFIG_FILE_DIR # Set this one to the folder location of the DiscordCoreAPIConfig.cmake generated while running CMake --install.
136136
- Opus_DIR # Set this one to the folder location of the file "OpusConfig.cmake".
137137
- unofficial-sodium_DIR # Set this one to the folder location of the file "unofficial-sodiumConfig.cmake".

0 commit comments

Comments
 (0)