From a6d102265e6f3381766e369dd643c9c728c2a1f7 Mon Sep 17 00:00:00 2001
From: RealTimeChris <40668522+RealTimeChris@users.noreply.github.com>
Date: Wed, 16 Oct 2024 09:42:37 -0400
Subject: [PATCH] DiscordCoreAPI Release v2.0.8
---
.github/workflows/MSVC-Windows-Binaries.yml | 72 ++
.github/workflows/MSVC-Windows.yml | 3 +-
CMake/DCADetectArchitecture.cmake | 17 +-
Documentation/Doxygen/Docs/Index.md | 18 +-
.../documentation_examples/music_bot/PlayQ.md | 2 +-
Include/discordcoreapi/FoundationEntities.hpp | 34 +-
.../discordcoreapi/JsonSpecializations.hpp | 32 +-
Include/discordcoreapi/Utilities.hpp | 45 +-
Include/discordcoreapi/Utilities/Etf.hpp | 410 +++------
.../discordcoreapi/Utilities/RingBuffer.hpp | 30 +-
.../Utilities/UnboundedMessageBlock.hpp | 4 +-
.../discordcoreapi/Utilities/UnorderedSet.hpp | 4 +-
.../Utilities/WebSocketClient.hpp | 4 +-
Library/CMake/BuildFeatureTester.bat | 2 -
ReadMe.md | 16 +-
Source/EventManager.cpp | 120 +--
Source/FoundationEntities.cpp | 8 +-
Source/SoundCloudAPI.cpp | 83 +-
Source/VoiceConnection.cpp | 12 +-
Source/WebSocketClient.cpp | 788 +++++++++---------
Source/YouTubeAPI.cpp | 4 +-
Vcpkg/ports/discordcoreapi/portfile.cmake | 3 +-
Vcpkg/ports/discordcoreapi/vcpkg.json | 2 +-
Vcpkg/versions/d-/discordcoreapi.json | 25 +
24 files changed, 864 insertions(+), 874 deletions(-)
create mode 100644 .github/workflows/MSVC-Windows-Binaries.yml
delete mode 100644 Library/CMake/BuildFeatureTester.bat
diff --git a/.github/workflows/MSVC-Windows-Binaries.yml b/.github/workflows/MSVC-Windows-Binaries.yml
new file mode 100644
index 000000000..8fc7e3b03
--- /dev/null
+++ b/.github/workflows/MSVC-Windows-Binaries.yml
@@ -0,0 +1,72 @@
+name: Build-and-Test-MSVC-Windows
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ - dev
+
+jobs:
+ Build:
+ runs-on: windows-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ msvc: [2022]
+ build_type: [Debug, Release]
+ std: [20]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Update Vcpkg and install other dependencies
+ run: |
+ cd C:/vcpkg
+ ./bootstrap-vcpkg.bat
+ git stash
+ git pull
+ vcpkg update
+
+ - name: Install the dependencies
+ run: |
+ vcpkg install opus:x64-windows
+ vcpkg install libsodium:x64-windows
+ vcpkg install openssl:x64-windows
+
+ - name: Configure CMake
+ working-directory: ./
+ run: |
+ cmake -S . -B ./Build -DDEV=true -DVCPKG_ROOT_DIR=C:/vcpkg
+
+ - name: Build the Test
+ working-directory: ./Build
+ run: |
+ cmake --build . --config=${{matrix.build_type}}
+
+ - name: Install the Test
+ working-directory: ./Build/
+ run: |
+ cmake --install ./ --config=${{matrix.build_type}}
+
+ - name: Clone DiscordCoreAPI-Binaries repository
+ run: |
+ git clone https://github.com/RealTimeChris/DiscordCoreAPI-Binaries.git ./DiscordCoreAPI-Binaries
+ cd DiscordCoreAPI-Binaries
+ git config user.name "GitHub Action"
+ git config user.email "action@github.com"
+
+ - name: Copy build artifacts to DiscordCoreAPI-Binaries
+ run: |
+ cp -r -Force "C:/Program Files (x86)/DiscordCoreAPI/*" ./DiscordCoreAPI-Binaries/${{matrix.build_type}} -v
+ cd ./DiscordCoreAPI-Binaries/${{matrix.build_type}}
+ Remove-Item -Force ./bin/discordcoreapi.pdb
+
+ - name: Commit and push changes to DiscordCoreAPI-Binaries
+ working-directory: ./DiscordCoreAPI-Binaries
+ run: |
+ git add .
+ git commit -m "Update binaries for ${{matrix.build_type}} build"
+ git push https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/RealTimeChris/DiscordCoreAPI-Binaries.git main
+ continue-on-error: true
diff --git a/.github/workflows/MSVC-Windows.yml b/.github/workflows/MSVC-Windows.yml
index 3790ab3ea..961bb1667 100644
--- a/.github/workflows/MSVC-Windows.yml
+++ b/.github/workflows/MSVC-Windows.yml
@@ -65,7 +65,6 @@ jobs:
- name: Copy build artifacts to DiscordCoreAPI-Binaries
run: |
- mkdir -p ./DiscordCoreAPI-Binaries/${{matrix.build_type}}
cp -r ./Tests/Install/${{matrix.build_type}}/* ./DiscordCoreAPI-Binaries/${{matrix.build_type}}
- name: Commit and push changes to DiscordCoreAPI-Binaries
@@ -73,5 +72,5 @@ jobs:
run: |
git add .
git commit -m "Update binaries for ${{matrix.build_type}} build"
- git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/RealTimeChris/DiscordCoreAPI-Binaries.git main
+ git push https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/RealTimeChris/DiscordCoreAPI-Binaries.git main
continue-on-error: true
diff --git a/CMake/DCADetectArchitecture.cmake b/CMake/DCADetectArchitecture.cmake
index 5edd8a3fa..f4b44e5ff 100644
--- a/CMake/DCADetectArchitecture.cmake
+++ b/CMake/DCADetectArchitecture.cmake
@@ -34,8 +34,19 @@ execute_process(
RESULT_VARIABLE DCA_CPU_INSTRUCTIONS_NEW
)
-set(AVX_FLAG "")
+function(is_numeric value result_var)
+ string(REGEX MATCH "^[0-9]+(\\.[0-9]+)?$" is_numeric_match "${value}")
+ if(is_numeric_match)
+ set(${result_var} TRUE PARENT_SCOPE)
+ else()
+ set(${result_var} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+is_numeric("${DCA_CPU_INSTRUCTIONS_NEW}" is_numeric_result)
+set(AVX_FLAG "")
+if (is_numeric_result)
math(EXPR DCA_CPU_INSTRUCTIONS_NUMERIC "${DCA_CPU_INSTRUCTIONS_NEW}")
math(EXPR DCA_CPU_INSTRUCTIONS 0)
@@ -99,6 +110,8 @@ else()
check_instruction_set("Avx2" "-mavx2;-mavx;-mlzcnt;-mpopcnt;-mbmi;-mbmi2" 0x40)
check_instruction_set("Avx512" "-mavx512f;-mavx2;-mavx;-mlzcnt;-mpopcnt;-mbmi;-mbmi2" 0x80)
endif()
-
+else()
+set(DCA_CPU_INSTRUCTIONS "0")
+endif()
set(AVX_FLAG "${AVX_FLAG}" CACHE STRING "AVX flags" FORCE)
set(DCA_CPU_INSTRUCTIONS "${DCA_CPU_INSTRUCTIONS}" CACHE STRING "CPU Instruction Sets" FORCE)
diff --git a/Documentation/Doxygen/Docs/Index.md b/Documentation/Doxygen/Docs/Index.md
index aa5ed0c5f..ca840302c 100644
--- a/Documentation/Doxygen/Docs/Index.md
+++ b/Documentation/Doxygen/Docs/Index.md
@@ -1,8 +1,8 @@
\mainpage DiscordCoreAPI
[![Codacy Badge](https://img.shields.io/codacy/grade/1e5ae970aed34d0b96249cdfd02099cf?color=lightblue&label=Code%20Quality&style=plastic)](https://www.codacy.com/gh/RealTimeChris/DiscordCoreAPI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=RealTimeChris/DiscordCoreAPI&utm_campaign=Badge_Grade)
-[![Discord](https://img.shields.io/discord/931640556814237706?color=red&label=Discord%20Server&style=plastic)](https://discord.gg/adgMqeBuhP)
+[![Discord](https://img.shields.io/discord/931640556814237706?color=red&label=Discord%20Server&style=plastic)](https://discord.gg/c33GH5BUe8)
![Commit Activity](https://img.shields.io/github/commit-activity/y/realtimechris/discordcoreapi?color=green&label=Commits&style=plastic)
-![Lines of Code](https://tokei.rs/b1/github/RealTimeChris/DiscordCoreAPI?color=light-blue&label=Lines%20Of%20Code%20&style=plastic)
+![Lines of Code](https://tokei.rs/b1/github/RealTimeChris/DiscordCoreAPI-Code-Only?color=light-blue&label=Lines%20Of%20Code%20&style=plastic)
Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in C++, that leverages custom asynchronous \ref discord_core_api::co_routine "CoRoutines", as well as a home-brew set of \ref discord_core_api::discord_core_internal::https_client "Https",
\ref discord_core_api::discord_core_internal::websocket_client "WebSocket", and \ref discord_core_api::voice_connection "Datagram" 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.
@@ -10,20 +10,20 @@ Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in
![imageDiscordCoreAPI](./TheLogo.png "A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.")
## Compiler Support
-![MSVC_20922](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC_2022-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=MSVC_2022&labelColor=pewter&color=blue)
-![CLANG_18](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG_18-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=CLANG_18&labelColor=pewter&color=blue)
-![GCC_13](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC_13-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=GCC_13&labelColor=pewter&color=blue)
+![MSVC_20922](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=MSVC_2022&labelColor=pewter&color=blue)
+![CLANG_18](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=CLANG_18&labelColor=pewter&color=blue)
+![GCC_13](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=GCC_13&labelColor=pewter&color=blue)
## Operating System Support
-![Windows](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC_2022-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=Windows&labelColor=pewter&color=blue)
-![Linux](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG_18-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=Linux&labelColor=pewter&color=blue)
-![Mac](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC_13-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=MacOS&labelColor=pewter&color=blue)
+![Windows](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=Windows&labelColor=pewter&color=blue)
+![Linux](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=Linux&labelColor=pewter&color=blue)
+![Mac](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=MacOS&labelColor=pewter&color=blue)
# Documentation/Examples
\ref documentation_examples
# Discord Server
-[This is a link to the Discord server!](https://discord.gg/adgMqeBuhP)
+[This is a link to the Discord server!](https://discord.gg/c33GH5BUe8)
# Bot Template
[A template for utilizing this library.](https://github.com/RealTimeChris/Bot-Template-for-DiscordCoreAPI)
diff --git a/Documentation/Doxygen/Docs/documentation_examples/music_bot/PlayQ.md b/Documentation/Doxygen/Docs/documentation_examples/music_bot/PlayQ.md
index a1e31462e..b1c4dc562 100644
--- a/Documentation/Doxygen/Docs/documentation_examples/music_bot/PlayQ.md
+++ b/Documentation/Doxygen/Docs/documentation_examples/music_bot/PlayQ.md
@@ -162,7 +162,7 @@ namespace discord_core_api {
if (trackNumber >= song_api::getPlaylist(guild_data.id).songQueue.size()) {
unique_ptr newEmbed{ makeUnique() };
newEmbed->setAuthor(newEvent.getUserName(), newEvent.getAvatarUrl());
- newEmbed->setDescription("------\n__**sorry, but that number is out of the range of the current track list!**__\n------");
+ newEmbed->setDescription("------\n__**sorry, but that number is out of the has_range of the current track list!**__\n------");
newEmbed->setTimeStamp(getTimeAndDate());
newEmbed->setTitle("__**playing issue:**__");
newEmbed->setColor(discordGuild.data.borderColor);
diff --git a/Include/discordcoreapi/FoundationEntities.hpp b/Include/discordcoreapi/FoundationEntities.hpp
index ce54f4108..0f4304785 100644
--- a/Include/discordcoreapi/FoundationEntities.hpp
+++ b/Include/discordcoreapi/FoundationEntities.hpp
@@ -30,6 +30,7 @@
#pragma once
#include
+#include
namespace discord_core_api {
@@ -321,23 +322,27 @@ namespace discord_core_api {
};
struct websocket_message {
- jsonifier::string t{};
+ std::optional t{};
+ std::optional s{};
int64_t op{ -1 };
- int64_t s{};
};
template struct websocket_message_data {
unordered_set jsonifierExcludedKeys{};
- jsonifier::string t{};
+ std::optional t{};
+ std::optional s{};
value_type d{};
int64_t op{};
- int64_t s{};
DCA_INLINE operator discord_core_internal::etf_serializer() {
etf_serializer data{};
data["op"] = op;
- data["s"] = s;
- data["t"] = t;
+ if (s.has_value()) {
+ data["s"] = s.value();
+ }
+ if (t.has_value()) {
+ data["t"] = t.value();
+ }
data["d"] = d.operator discord_core_internal::etf_serializer();
return data;
}
@@ -407,18 +412,20 @@ namespace discord_core_api {
template class flag_entity {
public:
- template DCA_INLINE auto setFlagValue(value_type02 theFlagToSet, bool enabled) {
- auto newValue = static_cast(static_cast(this)->flags);
+ template DCA_INLINE void setFlagValue(flag_type theFlagToSet, bool enabled) {
+ using underlying_type = std::underlying_type_t;
+ auto newValue = static_cast(static_cast(this)->flags);
if (enabled) {
- newValue |= static_cast(theFlagToSet);
+ newValue |= static_cast(theFlagToSet);
} else {
- newValue &= ~static_cast(theFlagToSet);
+ newValue &= ~static_cast(theFlagToSet);
}
- static_cast(this)->flags = static_cast(newValue);
+ static_cast(this)->flags = static_cast(newValue);
}
- template DCA_INLINE bool getFlagValue(value_type02 theFlagToCheckFor) const {
- return static_cast(static_cast(this)->flags) & static_cast(theFlagToCheckFor);
+ template DCA_INLINE bool getFlagValue(flag_type theFlagToCheckFor) const {
+ using underlying_type = std::underlying_type_t;
+ return static_cast(static_cast(this)->flags) & static_cast(theFlagToCheckFor);
}
protected:
@@ -426,6 +433,7 @@ namespace discord_core_api {
DCA_INLINE ~flag_entity() = default;
};
+
enum class user_image_types {
Banner = 0,
Default_Avatar = 1,
diff --git a/Include/discordcoreapi/JsonSpecializations.hpp b/Include/discordcoreapi/JsonSpecializations.hpp
index d68bb5950..bac3ebcd8 100644
--- a/Include/discordcoreapi/JsonSpecializations.hpp
+++ b/Include/discordcoreapi/JsonSpecializations.hpp
@@ -41,8 +41,8 @@ namespace discord_core_api {
websocket_message_data(const update_voice_state_data& data);
unordered_set jsonifierExcludedKeys{};
using type = update_voice_state_data;
+ std::optional t{};
int64_t op{ -1 };
- jsonifier::string t{};
int32_t s{};
type d{};
operator etf_serializer();
@@ -53,8 +53,8 @@ namespace discord_core_api {
websocket_message_data(const update_voice_state_data& data);
unordered_set jsonifierExcludedKeys{};
using type = update_voice_state_data_dc;
+ std::optional t{};
int64_t op{ -1 };
- jsonifier::string t{};
int32_t s{};
type d{};
operator etf_serializer();
@@ -65,13 +65,13 @@ namespace discord_core_api {
namespace jsonifier_internal {
template
- concept snowflake_t = std::same_as>;
+ concept snowflake_t = std::same_as>;
- template
- struct serialize_impl {
- template JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, serialize_context_type& serializePair) noexcept {
+ template
+ struct serialize_impl {
+ template JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type&index, indent_type& indent) noexcept {
jsonifier::string newString{ static_cast(value) };
- serialize::impl(newString, buffer, serializePair);
+ serialize::impl(newString, buffer, index, indent);
}
};
@@ -80,21 +80,21 @@ namespace jsonifier_internal {
jsonifier::raw_json_data newString{};
parse::impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
- value = newString.operator jsonifier::string();
+ value = newString.get();
} else {
- value = newString.operator uint64_t();
+ value = newString.get();
}
}
};
template
- concept time_stamp_t = std::same_as>;
+ concept time_stamp_t = std::same_as>;
- template
- struct serialize_impl {
- template JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, serialize_context_type& serializePair) noexcept {
+ template
+ struct serialize_impl {
+ template JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type& index, indent_type& indent) noexcept {
jsonifier::string newString{ static_cast(value) };
- serialize::impl(newString, buffer, serializePair);
+ serialize::impl(newString, buffer, index, indent);
}
};
@@ -104,9 +104,9 @@ namespace jsonifier_internal {
jsonifier::raw_json_data newString{};
parse::impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
- value = newString.operator jsonifier::string();
+ value = newString.get();
} else {
- value = newString.operator uint64_t();
+ value = newString.get();
}
}
};
diff --git a/Include/discordcoreapi/Utilities.hpp b/Include/discordcoreapi/Utilities.hpp
index f969e0a9d..b86a52a9a 100644
--- a/Include/discordcoreapi/Utilities.hpp
+++ b/Include/discordcoreapi/Utilities.hpp
@@ -164,27 +164,29 @@ namespace discord_core_api {
/// @brief Gateway intents.
enum class gateway_intents : uint32_t {
- guilds = 1 << 0,///< Intent for receipt of guild information.
- Guild_Members = 1 << 1,///< Intent for receipt of guild members.
- Guild_Bans = 1 << 2,///< Intent for receipt of guild bans.
- Guild_Emojis = 1 << 3,///< Intent for receipt of guild emojis.
- Guild_Integrations = 1 << 4,///< Intent for receipt of guild integrations.
- Guild_Webhooks = 1 << 5,///< Intent for receipt of guild webhooks.
- Guild_Invites = 1 << 6,///< Intent for receipt of guild invites.
- Guild_VoiceStates = 1 << 7,///< Intent for receipt of guild voice states.
- Guild_Presences = 1 << 8,///< Intent for receipt of guild presences.
- Guild_Messages = 1 << 9,///< Intent for receipt of guild messages.
- Guild_Message_Reactions = 1 << 10,///< Intent for receipt of guild message reactions.
- Guild_Message_Typing = 1 << 11,///< Intent for receipt of guild message typing notifications.
- Direct_Messages = 1 << 12,///< Intent for receipt of direct messages (dms).
- Direct_Message_Reactions = 1 << 13,///< Intent for receipt of direct message reactions.
- Direct_Message_Typing = 1 << 14,///< Intent for receipt of direct message typing notifications.
- Message_Content = 1 << 15,///< Intent for receipt of message content.
- Guild_Scheduled_Events = 1 << 16,///< Scheduled events.
- Auto_Moderation_Configuration = 1 << 20,/// auto moderation configuration.
- Auto_Moderation_Execution = 1 << 21,///< Auto moderation execution.
- Default_Intents = guilds | Guild_Bans | Guild_Emojis | Guild_Integrations | Guild_Webhooks | Guild_Invites | Guild_VoiceStates | Guild_Messages | Guild_Message_Reactions |
- Guild_Message_Typing | Direct_Messages | Direct_Message_Reactions | Direct_Message_Typing | Guild_Scheduled_Events | Auto_Moderation_Configuration |
+ Guilds = 1 << 0,
+ Guild_Members = 1 << 1,
+ Guild_Moderation = 1 << 2,
+ Guild_Expressions = 1 << 3,
+ Guild_Integrations = 1 << 4,
+ Guild_Webhooks = 1 << 5,
+ Guild_Invites = 1 << 6,
+ Guild_Voice_States = 1 << 7,
+ Guild_Presences = 1 << 8,
+ Guild_Messages = 1 << 9,
+ Guild_Message_Reactions = 1 << 10,
+ Guild_Message_Typing = 1 << 11,
+ Direct_Messages = 1 << 12,
+ Direct_Message_Reactions = 1 << 13,
+ Direct_Message_Typing = 1 << 14,
+ Message_Content = 1 << 15,
+ Guild_Scheduled_Events = 1 << 16,
+ Auto_Moderation_Configuration = 1 << 20,
+ Auto_Moderation_Execution = 1 << 21,
+ Guild_Message_Polls = 1 << 24,
+ Direct_Message_Polls = 1 << 25,///< Auto moderation execution.
+ Default_Intents = Guilds | Guild_Integrations | Guild_Webhooks | Guild_Invites | Guild_Voice_States | Guild_Messages | Guild_Message_Reactions | Guild_Message_Typing |
+ Direct_Messages | Direct_Message_Reactions | Direct_Message_Typing | Guild_Scheduled_Events | Auto_Moderation_Configuration |
Auto_Moderation_Execution,///< Default intents (all non-privileged intents).
Privileged_Intents = Guild_Members | Guild_Presences | Message_Content,///< Privileged intents requiring id.
All_Intents = Default_Intents | Privileged_Intents///< Every single intent.
@@ -534,7 +536,6 @@ namespace discord_core_api {
/// @brief Permissions_base class, for representing and manipulating permission values.
template class permissions_base {
public:
-
/// @brief Returns a string containing all of a given user's permissions_base for a given channel.
/// @param guildMember the guild_member_data who's permissions_base to analyze.
/// @param channel the channel_data withint which to check for permissions_base.
diff --git a/Include/discordcoreapi/Utilities/Etf.hpp b/Include/discordcoreapi/Utilities/Etf.hpp
index 6540805e1..b723d1be5 100644
--- a/Include/discordcoreapi/Utilities/Etf.hpp
+++ b/Include/discordcoreapi/Utilities/Etf.hpp
@@ -446,7 +446,8 @@ namespace discord_core_api {
/// @brief Constructor for etf_serialize_error.
/// @param message the error message.
/// @param location source location where the error occurred.
- DCA_INLINE etf_serialize_error(const jsonifier::string_view& message, std::source_location location = std::source_location::current()) : dca_exception{ message, location } {};
+ DCA_INLINE etf_serialize_error(const jsonifier::string_view& message, std::source_location location = std::source_location::current())
+ : dca_exception{ message, location } {};
};
/// @brief Enumeration for different json value types.
@@ -454,8 +455,8 @@ namespace discord_core_api {
/// @brief Concept for array types excluding etf_serializer.
template
- concept array_t = jsonifier::concepts::range && jsonifier::concepts::has_resize> &&
- jsonifier::concepts::has_emplace_back> && jsonifier::concepts::vector_subscriptable> &&
+ concept array_t = jsonifier::concepts::has_range && jsonifier::concepts::has_resize> &&
+ jsonifier::concepts::has_emplace_back> && jsonifier::concepts::vector_subscriptable> &&
requires(value_type&& data) { typename value_type::value_type; };
/// @brief Concept for object (associative container) types excluding etf_serializer.
@@ -463,7 +464,7 @@ namespace discord_core_api {
concept object_t = requires(value_type data) {
typename value_type::mapped_type;
typename value_type::key_type;
- } && jsonifier::concepts::range;
+ } && jsonifier::concepts::has_range;
class etf_serializer {
public:
@@ -476,53 +477,13 @@ namespace discord_core_api {
using int_type = int64_t;
using bool_type = bool;
- DCA_INLINE etf_serializer() = default;
+ DCA_INLINE etf_serializer(){
+ value = std::nullptr_t{};
+ };
DCA_INLINE etf_serializer& operator=(etf_serializer&& data) noexcept {
- destroy();
- stringReal = std::move(data.stringReal);
- type = data.type;
- data.type = json_type::null_t;
- switch (type) {
- case json_type::object_t: {
- objectValue = data.objectValue;
- data.objectValue = nullptr;
- break;
- }
- case json_type::array_t: {
- arrayValue = data.arrayValue;
- data.arrayValue = nullptr;
- break;
- }
- case json_type::string_t: {
- stringValue = data.stringValue;
- data.stringValue = nullptr;
- break;
- }
- case json_type::float_t: {
- floatValue = data.floatValue;
- data.floatValue = nullptr;
- break;
- }
- case json_type::int_t: {
- intValue = data.intValue;
- data.intValue = nullptr;
- break;
- }
- case json_type::uint_t: {
- uintValue = data.uintValue;
- data.uintValue = nullptr;
- break;
- }
- case json_type::bool_t: {
- boolValue = data.boolValue;
- data.boolValue = nullptr;
- break;
- }
- case json_type::null_t: {
- break;
- }
- }
+ stringReal.swap(data.stringReal);
+ value.swap(data.value);
return *this;
}
@@ -531,40 +492,7 @@ namespace discord_core_api {
}
DCA_INLINE etf_serializer& operator=(const etf_serializer& data) {
- destroy();
- switch (data.type) {
- case json_type::object_t: {
- setValue(data.getObject());
- break;
- }
- case json_type::array_t: {
- setValue(data.getArray());
- break;
- }
- case json_type::string_t: {
- setValue(data.getString());
- break;
- }
- case json_type::float_t: {
- setValue(data.getFloat());
- break;
- }
- case json_type::uint_t: {
- setValue(data.getUint());
- break;
- }
- case json_type::int_t: {
- setValue(data.getInt());
- break;
- }
- case json_type::bool_t: {
- setValue(data.getBool());
- break;
- }
- case json_type::null_t: {
- break;
- }
- }
+ value = data.value;
stringReal = data.stringReal;
return *this;
}
@@ -574,7 +502,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) noexcept {
- setValue(std::forward(data));
+ value = std::forward(data);
return *this;
}
@@ -583,7 +511,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) noexcept {
- setValue(std::forward(data));
+ value = std::forward(data);
return *this;
}
@@ -592,7 +520,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) noexcept {
- setValue(std::forward(data));
+ value = std::forward(data);
return *this;
}
@@ -601,7 +529,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(const char (&str)[str_length]) {
- setValue(str);
+ value = str;
return *this;
}
@@ -609,20 +537,20 @@ namespace discord_core_api {
*this = str;
}
- template DCA_INLINE etf_serializer& operator=(value_type&& data) {
- setValue(std::forward(data));
+ template DCA_INLINE etf_serializer& operator=(value_type&& data) {
+ value = std::forward(data);
return *this;
}
- template DCA_INLINE etf_serializer(value_type&& data) {
+ template DCA_INLINE etf_serializer(value_type&& data) {
*this = std::forward(data);
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) {
- if constexpr (jsonifier::concepts::signed_type) {
- setValue(std::forward(data));
- } else if constexpr (jsonifier::concepts::unsigned_type) {
- setValue(std::forward(data));
+ if constexpr (jsonifier::concepts::signed_t) {
+ value = static_cast(std::forward(data));
+ } else if constexpr (jsonifier::concepts::unsigned_t) {
+ value = static_cast(std::forward(data));
}
return *this;
}
@@ -632,7 +560,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) {
- setValue(std::forward(data));
+ value = std::forward(data);
return *this;
}
@@ -641,7 +569,7 @@ namespace discord_core_api {
}
template DCA_INLINE etf_serializer& operator=(value_type&& data) noexcept {
- setValue(static_cast(std::forward(data)));
+ value = static_cast(std::forward(data));
return *this;
}
@@ -650,38 +578,37 @@ namespace discord_core_api {
}
DCA_INLINE etf_serializer& operator=(json_type data) {
- destroy();
switch (data) {
case json_type::object_t: {
- setValue();
+ value = object_type{};
break;
}
case json_type::array_t: {
- setValue();
+ value = array_type{};
break;
}
case json_type::string_t: {
- setValue();
+ value = string_type{};
break;
}
case json_type::float_t: {
- setValue();
+ value = float_type{};
break;
}
case json_type::uint_t: {
- setValue();
+ value = uint_type{};
break;
}
case json_type::int_t: {
- setValue();
+ value = int_type{};
break;
}
case json_type::bool_t: {
- setValue();
+ value = bool_type{};
break;
}
case json_type::null_t: {
- setValue();
+ value = nullptr_t{};
break;
}
}
@@ -693,7 +620,23 @@ namespace discord_core_api {
}
DCA_INLINE json_type getType() const {
- return type;
+ if (std::holds_alternative(value)) {
+ return json_type::object_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::array_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::string_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::float_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::uint_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::int_t;
+ } else if (std::holds_alternative(value)) {
+ return json_type::bool_t;
+ } else {
+ return json_type::null_t;
+ }
}
DCA_INLINE operator jsonifier::string_base() {
@@ -704,22 +647,22 @@ namespace discord_core_api {
}
DCA_INLINE etf_serializer& operator[](typename object_type::key_type&& key) {
- if (type == json_type::null_t) {
- setValue();
+ if (getType() == json_type::null_t) {
+ value = object_type{};
}
- if (type == json_type::object_t) {
+ if (getType() == json_type::object_t) {
return getObject().operator[](std::forward(key));
}
throw etf_serialize_error{ "Sorry, but this value's type is not object." };
}
DCA_INLINE etf_serializer& operator[](uint_type index) {
- if (type == json_type::null_t) {
- setValue();
+ if (getType() == json_type::null_t) {
+ value = array_type{};
}
- if (type == json_type::array_t) {
+ if (getType() == json_type::array_t) {
if (index >= getArray().size()) {
getArray().resize(index + 1);
}
@@ -730,11 +673,11 @@ namespace discord_core_api {
}
DCA_INLINE void emplaceBack(etf_serializer&& data) {
- if (type == json_type::null_t) {
- setValue();
+ if (getType() == json_type::null_t) {
+ value = array_type{};
}
- if (type == json_type::array_t) {
+ if (getType() == json_type::array_t) {
getArray().emplace_back(std::move(data));
return;
}
@@ -742,11 +685,11 @@ namespace discord_core_api {
}
DCA_INLINE void emplaceBack(const etf_serializer& rhs) {
- if (type == json_type::null_t) {
- setValue();
+ if (getType() == json_type::null_t) {
+ value = array_type{};
}
- if (type == json_type::array_t) {
+ if (getType() == json_type::array_t) {
getArray().emplace_back(rhs);
return;
}
@@ -754,106 +697,118 @@ namespace discord_core_api {
}
DCA_INLINE bool_type operator==(const etf_serializer& rhs) const {
- if (rhs.type != type) {
+ if (rhs.getType() != getType()) {
return false;
}
- switch (type) {
- case json_type::object_t: {
- return *objectValue == *rhs.objectValue;
- }
- case json_type::array_t: {
- return *arrayValue == *rhs.arrayValue;
- }
- case json_type::string_t: {
- return *stringValue == *rhs.stringValue;
- }
- case json_type::float_t: {
- return *floatValue == *rhs.floatValue;
- }
- case json_type::uint_t: {
- return *uintValue == *rhs.uintValue;
- }
- case json_type::int_t: {
- return *intValue == *rhs.intValue;
- }
- case json_type::bool_t: {
- return *boolValue == *rhs.boolValue;
- }
- case json_type::null_t: {
- break;
- }
- }
- return true;
+ return value == rhs.value;
}
- DCA_INLINE object_type& getObject() const {
- if (type != json_type::object_t) {
+ DCA_INLINE object_type& getObject() {
+ if (getType() != json_type::object_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not object!" };
}
- return *objectValue;
+ return std::get(value);
}
- DCA_INLINE array_type& getArray() const {
- if (type != json_type::array_t) {
+ DCA_INLINE array_type& getArray() {
+ if (getType() != json_type::array_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not array!" };
}
- return *arrayValue;
+ return std::get(value);
}
- DCA_INLINE string_type& getString() const {
- if (type != json_type::string_t) {
+ DCA_INLINE string_type& getString() {
+ if (getType() != json_type::string_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not string!" };
}
- return *stringValue;
+ return std::get(value);
}
- DCA_INLINE float_type& getFloat() const {
- if (type != json_type::float_t) {
+ DCA_INLINE float_type& getFloat() {
+ if (getType() != json_type::float_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not float!" };
}
- return *floatValue;
+ return std::get(value);
}
- DCA_INLINE uint_type& getUint() const {
- if (type != json_type::uint_t) {
+ DCA_INLINE uint_type& getUint() {
+ if (getType() != json_type::uint_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not uint!" };
}
- return *uintValue;
+ return std::get(value);
}
- DCA_INLINE int_type& getInt() const {
- if (type != json_type::int_t) {
+ DCA_INLINE int_type& getInt() {
+ if (getType() != json_type::int_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not int!" };
}
- return *intValue;
+ return std::get(value);
}
- DCA_INLINE bool_type& getBool() const {
- if (type != json_type::bool_t) {
+ DCA_INLINE bool_type& getBool() {
+ if (getType() != json_type::bool_t) {
throw etf_serialize_error{ "Sorry, but this value's type is not bool!" };
}
- return *boolValue;
+ return std::get(value);
}
- DCA_INLINE ~etf_serializer() {
- destroy();
+ DCA_INLINE const object_type& getObject() const {
+ if (getType() != json_type::object_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not object!" };
+ }
+ return std::get(value);
}
+ DCA_INLINE const array_type& getArray() const {
+ if (getType() != json_type::array_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not array!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE const string_type& getString() const {
+ if (getType() != json_type::string_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not string!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE const float_type& getFloat() const {
+ if (getType() != json_type::float_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not float!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE const uint_type& getUint() const {
+ if (getType() != json_type::uint_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not uint!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE const int_type& getInt() const {
+ if (getType() != json_type::int_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not int!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE const bool_type& getBool() const {
+ if (getType() != json_type::bool_t) {
+ throw etf_serialize_error{ "Sorry, but this value's type is not bool!" };
+ }
+ return std::get(value);
+ }
+
+ DCA_INLINE ~etf_serializer() = default;
+
protected:
jsonifier::string_base stringReal{};
- json_type type{ json_type::null_t };
- union {
- object_type* objectValue;
- array_type* arrayValue;
- string_type* stringValue;
- float_type* floatValue;
- uint_type* uintValue;
- int_type* intValue;
- bool_type* boolValue;
- };
+ std::variant value{};
DCA_INLINE void serializeJsonToEtfString(const etf_serializer& dataToParse) {
- switch (dataToParse.type) {
+ switch (dataToParse.getType()) {
case json_type::object_t: {
return writeEtfObject(dataToParse.getObject());
}
@@ -1043,101 +998,6 @@ namespace discord_core_api {
uint8_t newBuffer[5]{ static_cast(etf_type::Small_Atom_Ext), static_cast(3), 'n', 'i', 'l' };
writeString(newBuffer, std::size(newBuffer));
}
-
- template DCA_INLINE void setValue(value_types&&... args) {
- destroy();
- type = typeNew;
- if constexpr (typeNew == json_type::object_t) {
- allocator alloc{};
- objectValue = alloc.allocate(1);
- alloc.construct(objectValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::array_t) {
- allocator alloc{};
- arrayValue = alloc.allocate(1);
- alloc.construct(arrayValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::string_t) {
- allocator alloc{};
- stringValue = alloc.allocate(1);
- alloc.construct(stringValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::float_t) {
- allocator alloc{};
- floatValue = alloc.allocate(1);
- alloc.construct(floatValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::uint_t) {
- allocator alloc{};
- uintValue = alloc.allocate(1);
- alloc.construct(uintValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::int_t) {
- allocator alloc{};
- intValue = alloc.allocate(1);
- alloc.construct(intValue, std::forward(args)...);
- } else if constexpr (typeNew == json_type::bool_t) {
- allocator alloc{};
- boolValue = alloc.allocate(1);
- alloc.construct(boolValue, std::forward(args)...);
- }
- }
-
- DCA_INLINE void destroy() {
- switch (type) {
- case json_type::object_t: {
- allocator alloc{};
- alloc.destroy(objectValue);
- alloc.deallocate(static_cast(objectValue));
- objectValue = nullptr;
- break;
- }
- case json_type::array_t: {
- allocator alloc{};
- alloc.destroy(arrayValue);
- alloc.deallocate(static_cast(arrayValue));
- arrayValue = nullptr;
- break;
- }
- case json_type::string_t: {
- allocator alloc{};
- alloc.destroy(stringValue);
- alloc.deallocate(static_cast(stringValue));
- stringValue = nullptr;
- break;
- }
- case json_type::float_t: {
- allocator alloc{};
- alloc.destroy(floatValue);
- alloc.deallocate(static_cast(floatValue));
- floatValue = nullptr;
- break;
- }
- case json_type::uint_t: {
- allocator alloc{};
- alloc.destroy(uintValue);
- alloc.deallocate(static_cast(uintValue));
- uintValue = nullptr;
- break;
- }
- case json_type::int_t: {
- allocator alloc{};
- alloc.destroy(intValue);
- alloc.deallocate(static_cast(intValue));
- intValue = nullptr;
- break;
- }
- case json_type::bool_t: {
- allocator alloc{};
- alloc.destroy(boolValue);
- alloc.deallocate(static_cast(boolValue));
- boolValue = nullptr;
- break;
- }
- case json_type::null_t: {
- break;
- }
- default: {
- break;
- }
- }
- type = json_type::null_t;
- }
};
/**@}*/
diff --git a/Include/discordcoreapi/Utilities/RingBuffer.hpp b/Include/discordcoreapi/Utilities/RingBuffer.hpp
index a7134eba6..90de1f4bd 100644
--- a/Include/discordcoreapi/Utilities/RingBuffer.hpp
+++ b/Include/discordcoreapi/Utilities/RingBuffer.hpp
@@ -63,10 +63,10 @@ namespace discord_core_api {
arrayValue.resize(size);
}
- DCA_INLINE ring_buffer_interface& operator=(ring_buffer_interface&&) noexcept = default;
- DCA_INLINE ring_buffer_interface(ring_buffer_interface&&) noexcept = default;
- DCA_INLINE ring_buffer_interface& operator=(const ring_buffer_interface&) noexcept = default;
- DCA_INLINE ring_buffer_interface(const ring_buffer_interface&) noexcept = default;
+ DCA_INLINE ring_buffer_interface& operator=(ring_buffer_interface&&) noexcept = default;
+ DCA_INLINE ring_buffer_interface(ring_buffer_interface&&) noexcept = default;
+ DCA_INLINE ring_buffer_interface& operator=(const ring_buffer_interface&) noexcept = default;
+ DCA_INLINE ring_buffer_interface(const ring_buffer_interface&) noexcept = default;
// forward declaration to grant friendship to the ring_buffer class.
template friend class ring_buffer;
@@ -125,7 +125,7 @@ namespace discord_core_api {
}
protected:
- jsonifier::vector> arrayValue{};///< The underlying data array.
+ jsonifier::vector> arrayValue{};///< The underlying data array.
size_type tail{};///< The tail position in the buffer.
size_type head{};///< The head position in the buffer.
};
@@ -134,18 +134,18 @@ namespace discord_core_api {
/// @tparam value_type the type of data stored in the buffer.
/// @tparam slice_count the number of slices.
template class ring_buffer
- : public ring_buffer_interface, 1024 * 16>, slice_count> {
+ : public ring_buffer_interface, 1024 * 16>, slice_count> {
public:
- using base_type = ring_buffer_interface, 1024 * 16>, slice_count>;
- using value_type = typename ring_buffer_interface, 1024 * 16>::value_type;
+ using base_type = ring_buffer_interface, 1024 * 16>, slice_count>;
+ using value_type = typename ring_buffer_interface, 1024 * 16>::value_type;
using const_pointer = const value_type*;
using pointer = value_type*;
using size_type = uint64_t;
/// @brief Default constructor. initializes the buffer size.
- DCA_INLINE ring_buffer() noexcept = default;
- DCA_INLINE ring_buffer& operator=(ring_buffer&&) noexcept = default;
- DCA_INLINE ring_buffer(ring_buffer&&) noexcept = default;
+ DCA_INLINE ring_buffer() noexcept = default;
+ DCA_INLINE ring_buffer& operator=(ring_buffer&&) noexcept = default;
+ DCA_INLINE ring_buffer(ring_buffer&&) noexcept = default;
DCA_INLINE ring_buffer& operator=(const ring_buffer&) noexcept = default;
DCA_INLINE ring_buffer(const ring_buffer&) noexcept = default;
@@ -166,11 +166,11 @@ namespace discord_core_api {
/// @brief Read data from the buffer.
/// @return a string view containing the read data.
- DCA_INLINE jsonifier::string_view_base> readData() {
- jsonifier::string_view_base> returnData{};
+ DCA_INLINE jsonifier::string_view_base> readData() {
+ jsonifier::string_view_base> returnData{};
if (base_type::getCurrentTail()->getUsedSpace() > 0) {
- returnData = jsonifier::string_view_base>{ base_type::getCurrentTail()->getCurrentTail(),
- base_type::getCurrentTail()->getUsedSpace() };
+ returnData =
+ jsonifier::string_view_base>{ base_type::getCurrentTail()->getCurrentTail(), base_type::getCurrentTail()->getUsedSpace() };
base_type::getCurrentTail()->clear();
base_type::modifyReadOrWritePosition(ring_buffer_access_type::read, 1);
}
diff --git a/Include/discordcoreapi/Utilities/UnboundedMessageBlock.hpp b/Include/discordcoreapi/Utilities/UnboundedMessageBlock.hpp
index d938b6670..c4c2029ca 100644
--- a/Include/discordcoreapi/Utilities/UnboundedMessageBlock.hpp
+++ b/Include/discordcoreapi/Utilities/UnboundedMessageBlock.hpp
@@ -34,7 +34,7 @@
namespace discord_core_api {
template
- concept copyable_or_movable = std::copyable> || std::movable>;
+ concept copyable_or_movable = std::copyable> || std::movable>;
/// @brief A thread-safe messaging block for data-structures.
/// @tparam value_type the type of object that will be sent over the message block.
@@ -87,7 +87,7 @@ namespace discord_core_api {
std::mutex accessMutex{};
};
- template DCA_INLINE bool waitForTimeToPass(unbounded_message_block>& outBuffer, value_type& argOne, uint64_t timeInMsNew) {
+ template DCA_INLINE bool waitForTimeToPass(unbounded_message_block>& outBuffer, value_type& argOne, uint64_t timeInMsNew) {
stop_watch stopWatch{ milliseconds{ timeInMsNew } };
stopWatch.reset();
while (!outBuffer.tryReceive(argOne)) {
diff --git a/Include/discordcoreapi/Utilities/UnorderedSet.hpp b/Include/discordcoreapi/Utilities/UnorderedSet.hpp
index bfa465513..033e7bff2 100644
--- a/Include/discordcoreapi/Utilities/UnorderedSet.hpp
+++ b/Include/discordcoreapi/Utilities/UnorderedSet.hpp
@@ -36,7 +36,7 @@ namespace discord_core_api {
template class unordered_set;
template
- concept set_container_iterator_t = std::same_as::iterator, jsonifier_internal::unwrap_t>;
+ concept set_container_iterator_t = std::same_as::iterator, std::remove_cvref_t>;
template
class unordered_set : protected hash_policy>, protected jsonifier_internal::alloc_wrapper, protected object_compare {
@@ -309,7 +309,7 @@ namespace discord_core_api {
}
template DCA_INLINE uint64_t getKey(value_type_newer&& keyValue) const {
- return key_accessor>::getHashKey(std::forward(keyValue));
+ return key_accessor>::getHashKey(std::forward(keyValue));
}
DCA_INLINE void resize(size_type capacityNew) {
diff --git a/Include/discordcoreapi/Utilities/WebSocketClient.hpp b/Include/discordcoreapi/Utilities/WebSocketClient.hpp
index 025d4a255..59f02f4a0 100644
--- a/Include/discordcoreapi/Utilities/WebSocketClient.hpp
+++ b/Include/discordcoreapi/Utilities/WebSocketClient.hpp
@@ -234,7 +234,7 @@ namespace discord_core_api {
};
/// @brief A websocket client, for communication via a tcp-connection.
- class websocket_client : public websocket_core {
+ class DiscordCoreAPI_Dll websocket_client : public websocket_core {
public:
friend struct discord_core_api::on_voice_server_update_data;
friend struct discord_core_api::on_voice_state_update_data;
@@ -275,7 +275,7 @@ namespace discord_core_api {
snowflake userId{};
};
- class base_socket_agent {
+ class DiscordCoreAPI_Dll base_socket_agent {
public:
friend class discord_core_api::discord_core_client;
friend class discord_core_api::bot_user;
diff --git a/Library/CMake/BuildFeatureTester.bat b/Library/CMake/BuildFeatureTester.bat
deleted file mode 100644
index 62c7a1dd1..000000000
--- a/Library/CMake/BuildFeatureTester.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -S ./ -B ./Build -DCMAKE_BUILD_TYPE=Release
-"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" --build ./Build --config=Release
\ No newline at end of file
diff --git a/ReadMe.md b/ReadMe.md
index 0f946bc58..70c83c5ad 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -1,6 +1,6 @@
# DiscordCoreAPI
[![Codacy Badge](https://img.shields.io/codacy/grade/1e5ae970aed34d0b96249cdfd02099cf?color=lightblue&label=Code%20Quality&style=plastic)](https://www.codacy.com/gh/RealTimeChris/DiscordCoreAPI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=RealTimeChris/DiscordCoreAPI&utm_campaign=Badge_Grade)
-[![Discord](https://img.shields.io/discord/931640556814237706?color=red&label=Discord%20Server&style=plastic)](https://discord.gg/adgMqeBuhP)
+[![Discord](https://img.shields.io/discord/931640556814237706?color=red&label=Discord%20Server&style=plastic)](https://discord.gg/c33GH5BUe8)
![Commit Activity](https://img.shields.io/github/commit-activity/y/realtimechris/discordcoreapi?color=green&label=Commits&style=plastic)
![Lines of Code](https://tokei.rs/b1/github/RealTimeChris/DiscordCoreAPI-Code-Only?color=light-blue&label=Lines%20Of%20Code%20&style=plastic)
@@ -11,20 +11,20 @@ Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in
alt="DiscordCoreAPI WebSite" width="500"/>
## Compiler Support
-![MSVC_20922](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC_2022-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=MSVC_2022&labelColor=pewter&color=blue)
-![CLANG_18](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG_18-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=CLANG_18&labelColor=pewter&color=blue)
-![GCC_13](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC_13-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=GCC_13&labelColor=pewter&color=blue)
+![MSVC_20922](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=MSVC_2022&labelColor=pewter&color=blue)
+![CLANG_18](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=CLANG_18&labelColor=pewter&color=blue)
+![GCC_13](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=GCC_13&labelColor=pewter&color=blue)
## Operating System Support
-![Windows](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC_2022-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=Windows&labelColor=pewter&color=blue)
-![Linux](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG_18-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=Linux&labelColor=pewter&color=blue)
-![Mac](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC_13-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=MacOS&labelColor=pewter&color=blue)
+![Windows](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/MSVC-Windows.yml?style=plastic&logo=microsoft&logoColor=green&label=Windows&labelColor=pewter&color=blue)
+![Linux](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/CLANG-Ubuntu.yml?style=plastic&logo=linux&logoColor=green&label=Linux&labelColor=pewter&color=blue)
+![Mac](https://img.shields.io/github/actions/workflow/status/RealTimeChris/DiscordCoreAPI/GCC-MacOS.yml?style=plastic&logo=apple&logoColor=green&label=MacOS&labelColor=pewter&color=blue)
# Documentation/Examples
[Documentation/Examples](https://discordcoreapi.com/documentation_examples.html)
# Discord Server
-[This is a link to the Discord server!](https://discord.gg/adgMqeBuhP)
+[This is a link to the Discord server!](https://discord.gg/c33GH5BUe8)
# Bot Template
[A template for utilizing this library.](https://github.com/RealTimeChris/Bot-Template-for-DiscordCoreAPI)
diff --git a/Source/EventManager.cpp b/Source/EventManager.cpp
index daf1d24cf..24e155768 100644
--- a/Source/EventManager.cpp
+++ b/Source/EventManager.cpp
@@ -186,7 +186,7 @@ namespace discord_core_api {
template<> unordered_map*> object_collector::objectsBuffersMap;
on_input_event_creation_data::on_input_event_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -196,7 +196,7 @@ namespace discord_core_api {
on_application_command_permissions_update_data::on_application_command_permissions_update_data(jsonifier::jsonifier_core& parserNew,
jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -205,7 +205,7 @@ namespace discord_core_api {
}
on_auto_moderation_rule_creation_data::on_auto_moderation_rule_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -214,7 +214,7 @@ namespace discord_core_api {
}
on_auto_moderation_rule_update_data::on_auto_moderation_rule_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -223,7 +223,7 @@ namespace discord_core_api {
}
on_auto_moderation_rule_deletion_data::on_auto_moderation_rule_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -232,7 +232,7 @@ namespace discord_core_api {
}
on_auto_moderation_action_execution_data::on_auto_moderation_action_execution_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -241,7 +241,7 @@ namespace discord_core_api {
}
on_channel_creation_data::on_channel_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -258,7 +258,7 @@ namespace discord_core_api {
}
on_channel_update_data::on_channel_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (channels::doWeCacheChannels()) {
oldValue = channels::getCachedChannel({ .channelId = value.id });
channels::insertChannel(static_cast(value));
@@ -266,7 +266,7 @@ namespace discord_core_api {
}
on_channel_deletion_data::on_channel_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -287,7 +287,7 @@ namespace discord_core_api {
}
on_channel_pins_update_data::on_channel_pins_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -296,7 +296,7 @@ namespace discord_core_api {
}
on_thread_creation_data::on_thread_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -305,7 +305,7 @@ namespace discord_core_api {
}
on_thread_update_data::on_thread_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -314,7 +314,7 @@ namespace discord_core_api {
}
on_thread_deletion_data::on_thread_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -323,7 +323,7 @@ namespace discord_core_api {
}
on_thread_list_sync_data::on_thread_list_sync_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -332,7 +332,7 @@ namespace discord_core_api {
}
on_thread_member_update_data::on_thread_member_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -341,7 +341,7 @@ namespace discord_core_api {
}
on_thread_members_update_data::on_thread_members_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -350,7 +350,7 @@ namespace discord_core_api {
}
on_guild_creation_data::on_guild_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -416,7 +416,7 @@ namespace discord_core_api {
}
on_guild_update_data::on_guild_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (guilds::doWeCacheGuilds()) {
oldValue = guilds::getCachedGuild({ value.id });
guilds::insertGuild(static_cast(value));
@@ -424,7 +424,7 @@ namespace discord_core_api {
}
on_guild_deletion_data::on_guild_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -445,7 +445,7 @@ namespace discord_core_api {
}
on_guild_ban_add_data::on_guild_ban_add_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -462,7 +462,7 @@ namespace discord_core_api {
}
on_guild_ban_remove_data::on_guild_ban_remove_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -471,7 +471,7 @@ namespace discord_core_api {
}
on_guild_emojis_update_data::on_guild_emojis_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -486,7 +486,7 @@ namespace discord_core_api {
}
on_guild_stickers_update_data::on_guild_stickers_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -495,7 +495,7 @@ namespace discord_core_api {
}
on_guild_integrations_update_data::on_guild_integrations_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -504,7 +504,7 @@ namespace discord_core_api {
}
on_guild_member_add_data::on_guild_member_add_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -522,7 +522,7 @@ namespace discord_core_api {
}
on_guild_member_remove_data::on_guild_member_remove_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -545,7 +545,7 @@ namespace discord_core_api {
}
on_guild_member_update_data::on_guild_member_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (guild_members::doWeCacheGuildMembers()) {
oldValue = guild_members::getCachedGuildMember({ .guildMemberId = value.user.id, .guildId = value.guildId });
guild_members::insertGuildMember(static_cast(value));
@@ -553,7 +553,7 @@ namespace discord_core_api {
}
on_guild_members_chunk_data::on_guild_members_chunk_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -562,7 +562,7 @@ namespace discord_core_api {
}
on_role_creation_data::on_role_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -579,7 +579,7 @@ namespace discord_core_api {
}
on_role_update_data::on_role_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (roles::doWeCacheRoles()) {
oldValue = roles::getCachedRole({ .guildId = value.guildId, .roleId = value.role.id });
roles::insertRole(static_cast(value.role));
@@ -587,7 +587,7 @@ namespace discord_core_api {
}
on_role_deletion_data::on_role_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -609,7 +609,7 @@ namespace discord_core_api {
on_voice_server_update_data::on_voice_server_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse,
discord_core_internal::websocket_client* sslShard) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -633,7 +633,7 @@ namespace discord_core_api {
};
on_guild_scheduled_event_creation_data::on_guild_scheduled_event_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -642,7 +642,7 @@ namespace discord_core_api {
}
on_guild_scheduled_event_update_data::on_guild_scheduled_event_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -651,7 +651,7 @@ namespace discord_core_api {
}
on_guild_scheduled_event_deletion_data::on_guild_scheduled_event_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -660,7 +660,7 @@ namespace discord_core_api {
}
on_guild_scheduled_event_user_add_data::on_guild_scheduled_event_user_add_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -669,7 +669,7 @@ namespace discord_core_api {
}
on_guild_scheduled_event_user_remove_data::on_guild_scheduled_event_user_remove_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -678,7 +678,7 @@ namespace discord_core_api {
}
on_integration_creation_data::on_integration_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -687,7 +687,7 @@ namespace discord_core_api {
}
on_integration_update_data::on_integration_update_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -696,7 +696,7 @@ namespace discord_core_api {
}
on_integration_deletion_data::on_integration_deletion_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -705,7 +705,7 @@ namespace discord_core_api {
}
on_interaction_creation_data::on_interaction_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError(valueNew.reportError());
@@ -789,7 +789,7 @@ namespace discord_core_api {
}
on_invite_creation_data::on_invite_creation_data(jsonifier::jsonifier_core& parserNew, jsonifier::string_view_base dataToParse) {
- parserNew.parseJson(*static_cast(this), dataToParse);
+ parserNew.parseJson(*static_cast(this), dataToParse);
if (auto result = parserNew.getErrors(); result.size() > 0) {
for (auto& valueNew: result) {
message_printer::printError