Skip to content

Commit 163b919

Browse files
committed
Update ReadMe.md
1 parent 1c1d933 commit 163b919

File tree

79 files changed

+8287
-10054
lines changed

Some content is hidden

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

79 files changed

+8287
-10054
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
33
#
4-
# Copyright 2021, 2022 Chris M. (RealTimeChris)
4+
# Copyright 2021, 2022, 2023 Chris M. (RealTimeChris)
55
#
66
# This library is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU Lesser General Public

CMakePresets.json

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@
22
"buildPresets": [
33
{
44
"configuration": "Release",
5-
"configurePreset": "Windows-Release-With-ASAN",
5+
"configurePreset": "x64-MSVC-Release-ASAN",
66
"description": "Target Windows with the Visual Studio development environment, with address sanitizer.",
7-
"displayName": "Windows x64 Release With ASAN - Build",
7+
"displayName": "x64-MSVC-Release-ASAN",
88
"inheritConfigureEnvironment": true,
9-
"name": "Windows-Release-With-ASAN",
9+
"name": "x64-MSVC-Release-ASAN",
1010
"verbose": true
1111
},
1212
{
1313
"configuration": "Debug",
14-
"configurePreset": "Windows-Debug-With-ASAN",
14+
"configurePreset": "x64-MSVC-Debug-ASAN",
1515
"description": "Target Windows with the Visual Studio development environment, with address sanitizer.",
16-
"displayName": "Windows x64 Debug With ASAN - Build",
16+
"displayName": "x64-MSVC-Debug-ASAN",
1717
"inheritConfigureEnvironment": true,
18-
"name": "Windows-Debug-With-ASAN",
18+
"name": "x64-MSVC-Debug-ASAN",
1919
"verbose": true
2020
},
2121
{
2222
"configuration": "Release",
23-
"configurePreset": "Windows-Release",
23+
"configurePreset": "x64-MSVC-Release",
2424
"description": "Target Windows with the Visual Studio development environment.",
25-
"displayName": "Windows x64 Release - Build",
25+
"displayName": "x64-MSVC-Release",
2626
"inheritConfigureEnvironment": true,
27-
"name": "Windows-Release",
27+
"name": "x64-MSVC-Release",
2828
"verbose": true
2929
},
3030
{
3131
"configuration": "Debug",
32-
"configurePreset": "Windows-Debug",
32+
"configurePreset": "x64-MSVC-Debug",
3333
"description": "Target Windows with the Visual Studio development environment.",
34-
"displayName": "Windows x64 Debug - Build",
34+
"displayName": "x64-MSVC-Debug",
3535
"inheritConfigureEnvironment": true,
36-
"name": "Windows-Debug",
36+
"name": "x64-MSVC-Debug",
3737
"verbose": true
3838
},
3939
{
4040
"configuration": "Release",
41-
"configurePreset": "Linux-Release-With-ASAN",
41+
"configurePreset": "x64-GNU-Release-ASAN",
4242
"description": "Target Linux with the g++-11 compiler, with address sanitizer.",
43-
"displayName": "Linux x64 Release With ASAN - Build",
43+
"displayName": "x64-GNU-Release-ASAN",
4444
"inheritConfigureEnvironment": true,
45-
"name": "Linux-Release-With-ASAN",
45+
"name": "x64-GNU-Release-ASAN",
4646
"verbose": true
4747
},
4848
{
4949
"configuration": "Release",
50-
"configurePreset": "Linux-Release",
50+
"configurePreset": "x64-GNU-Release",
5151
"description": "Target Linux with the g++-11 compiler.",
52-
"displayName": "Linux x64 Release - Build",
52+
"displayName": "x64-GNU-Release",
5353
"inheritConfigureEnvironment": true,
54-
"name": "Linux-Release",
54+
"name": "x64-GNU-Release",
5555
"verbose": true
5656
},
5757
{
5858
"configuration": "Debug",
59-
"configurePreset": "Linux-Debug",
59+
"configurePreset": "x64-GNU-Debug",
6060
"description": "Target Linux with the g++-11 compiler.",
61-
"displayName": "Linux x64 Debug - Build",
61+
"displayName": "x64-GNU-Debug",
6262
"inheritConfigureEnvironment": true,
63-
"name": "Linux-Debug",
63+
"name": "x64-GNU-Debug",
6464
"verbose": true
6565
}
6666
],
@@ -76,7 +76,10 @@
7676
"value": "x64"
7777
},
7878
"binaryDir": "${sourceDir}/Build/Release",
79-
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" },
79+
"cacheVariables": {
80+
"CMAKE_BUILD_TYPE": "Release",
81+
"ASAN_ENABLED": false
82+
},
8083
"condition": {
8184
"lhs": "${hostSystemName}",
8285
"rhs": "Windows",
@@ -85,7 +88,7 @@
8588
"description": "Target Windows with the Visual Studio development environment.",
8689
"displayName": "Windows x64 Release - Config",
8790
"generator": "Visual Studio 17 2022",
88-
"name": "Windows-Release",
91+
"name": "x64-MSVC-Release",
8992
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
9093
},
9194
{
@@ -94,7 +97,10 @@
9497
"value": "x64"
9598
},
9699
"binaryDir": "${sourceDir}/Build/Debug",
97-
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" },
100+
"cacheVariables": {
101+
"CMAKE_BUILD_TYPE": "Debug",
102+
"ASAN_ENABLED": false
103+
},
98104
"condition": {
99105
"lhs": "${hostSystemName}",
100106
"rhs": "Windows",
@@ -103,7 +109,7 @@
103109
"description": "Target Windows with the Visual Studio development environment.",
104110
"displayName": "Windows x64 Debug - Config",
105111
"generator": "Visual Studio 17 2022",
106-
"name": "Windows-Debug",
112+
"name": "x64-MSVC-Debug",
107113
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
108114
},
109115
{
@@ -112,17 +118,19 @@
112118
"value": "x64"
113119
},
114120
"binaryDir": "${sourceDir}/Build/Release-With-ASAN",
115-
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" },
121+
"cacheVariables": {
122+
"CMAKE_BUILD_TYPE": "Release",
123+
"ASAN_ENABLED": true
124+
},
116125
"condition": {
117126
"lhs": "${hostSystemName}",
118127
"rhs": "Windows",
119128
"type": "equals"
120129
},
121130
"description": "Target Windows with the Visual Studio development environment.",
122131
"displayName": "Windows x64 Release With ASAN - Config",
123-
"environment": { "EnableASAN": "true" },
124132
"generator": "Visual Studio 17 2022",
125-
"name": "Windows-Release-With-ASAN",
133+
"name": "x64-MSVC-Release-ASAN",
126134
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
127135
},
128136
{
@@ -131,32 +139,36 @@
131139
"value": "x64"
132140
},
133141
"binaryDir": "${sourceDir}/Build/Debug-With-ASAN",
134-
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" },
142+
"cacheVariables": {
143+
"CMAKE_BUILD_TYPE": "Debug",
144+
"ASAN_ENABLED": true
145+
},
135146
"condition": {
136147
"lhs": "${hostSystemName}",
137148
"rhs": "Windows",
138149
"type": "equals"
139150
},
140151
"description": "Target Windows with the Visual Studio development environment.",
141152
"displayName": "Windows x64 Debug With ASAN - Config",
142-
"environment": { "EnableASAN": "true" },
143153
"generator": "Visual Studio 17 2022",
144-
"name": "Windows-Debug-With-ASAN",
154+
"name": "x64-MSVC-Debug-ASAN",
145155
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
146156
},
147157
{
148158
"binaryDir": "${sourceDir}/Build/Release-With-ASAN",
149-
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" },
159+
"cacheVariables": {
160+
"CMAKE_BUILD_TYPE": "Release",
161+
"ASAN_ENABLED": true
162+
},
150163
"condition": {
151164
"lhs": "${hostSystemName}",
152165
"rhs": "Linux",
153166
"type": "equals"
154167
},
155168
"description": "Target Linux with the g++-11 compiler.",
156169
"displayName": "Linux x64 Release - Config",
157-
"environment": { "EnableASAN": "true" },
158170
"generator": "Ninja Multi-Config",
159-
"name": "Linux-Release-With-ASAN",
171+
"name": "x64-GNU-Release-ASAN",
160172
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] } }
161173
},
162174
{
@@ -170,7 +182,7 @@
170182
"description": "Target Linux with the g++-11 compiler.",
171183
"displayName": "Linux x64 Release - Config",
172184
"generator": "Ninja Multi-Config",
173-
"name": "Linux-Release",
185+
"name": "x64-GNU-Release",
174186
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] } }
175187
},
176188
{
@@ -184,7 +196,7 @@
184196
"description": "Target Linux with the g++-11 compiler.",
185197
"displayName": "Linux x64 Debug - Config",
186198
"generator": "Ninja Multi-Config",
187-
"name": "Linux-Debug",
199+
"name": "x64-GNU-Debug",
188200
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] } }
189201
}
190202
],

Include/discordcoreapi/ApplicationCommandEntities.hpp

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
33
4-
Copyright 2021, 2022 Chris M. (RealTimeChris)
4+
Copyright 2021, 2022, 2023 Chris M. (RealTimeChris)
55
66
This library is free software; you can redistribute it and/or
77
modify it under the terms of the GNU Lesser General Public
@@ -29,7 +29,7 @@
2929
#include <discordcoreapi/Https.hpp>
3030

3131
namespace DiscordCoreAPI {
32-
32+
/*
3333
/**
3434
* \addtogroup foundation_entities
3535
* @{
@@ -56,9 +56,7 @@ namespace DiscordCoreAPI {
5656
};
5757

5858
/// \brief For creating a single global ApplicationCommand.
59-
struct DiscordCoreAPI_Dll CreateGlobalApplicationCommandData : public CreateApplicationCommandData {
60-
operator Jsonifier();
61-
};
59+
struct DiscordCoreAPI_Dll CreateGlobalApplicationCommandData : public CreateApplicationCommandData {};
6260

6361
/// \brief For editing a single global ApplicationCommand.
6462
struct DiscordCoreAPI_Dll EditGlobalApplicationCommandData {
@@ -72,8 +70,6 @@ namespace DiscordCoreAPI {
7270
Snowflake applicationId{};///< The current application's Id (The Bot's User Id).
7371
bool dmPermission{};///< Indicates whether the command is available in DMs with the app.
7472
std::string name{};///< A name for the new command.
75-
76-
operator Jsonifier();
7773
};
7874

7975
/// \brief For deleting a single global ApplicationCommand.
@@ -96,9 +92,7 @@ namespace DiscordCoreAPI {
9692
};
9793

9894
/// \brief For creating a single Guild ApplicationCommand.
99-
struct DiscordCoreAPI_Dll CreateGuildApplicationCommandData : public CreateGlobalApplicationCommandData {
100-
operator Jsonifier();
101-
};
95+
struct DiscordCoreAPI_Dll CreateGuildApplicationCommandData : public CreateGlobalApplicationCommandData {};
10296

10397
/// \brief For acquiring a single Guild ApplicationCommand.
10498
struct DiscordCoreAPI_Dll GetGuildApplicationCommandData {
@@ -118,8 +112,6 @@ namespace DiscordCoreAPI {
118112
bool dmPermission{};///< Indicates whether the command is available in DMs with the app.
119113
Snowflake guildId{};///< The id of the Guild which you would like to add the new command to.
120114
std::string name{};///< A name for the new command.
121-
122-
operator Jsonifier();
123115
};
124116

125117
/// \brief For deleting a single Guild ApplicationCommand.
@@ -156,43 +148,16 @@ namespace DiscordCoreAPI {
156148
Snowflake applicationId{};///< The current application's Id (The Bot's User Id).
157149
uint64_t commandId{};///< The command id which you would like to edit the permissions of.
158150
Snowflake guildId{};///< The Guild id of the Guild for which you would like to edit the command permissions.
159-
160-
operator Jsonifier();
161151
};
162152

163153
/// \brief For batch editing the permissions of a collection of Guild ApplicationCommands.
164154
struct DiscordCoreAPI_Dll BatchEditGuildApplicationCommandPermissionsData {
165-
std::vector<GuildApplicationCommandPermissionsData> permissions{};///< A vector of edit-Guild-application-permissions responseData to edit.
155+
std::vector<DiscordCoreAPI::GuildApplicationCommandPermissionsData>
156+
permissions{};///< A vector of edit-Guild-application-permissions responseData to edit.
166157
Snowflake applicationId{};///< The current application's Id (The Bot's User Id).
167158
Snowflake guildId{};///< The Guild id of the Guild for which you would like to batch edit Guild application permissions.
168159
};
169160

170-
/// \brief A single ApplicationCommand.
171-
class DiscordCoreAPI_Dll ApplicationCommand : public ApplicationCommandData {
172-
public:
173-
ApplicationCommand() noexcept = default;
174-
175-
ApplicationCommand(simdjson::ondemand::value jsonObjectData);
176-
177-
virtual ~ApplicationCommand() noexcept = default;
178-
};
179-
180-
class DiscordCoreAPI_Dll ApplicationCommandVector {
181-
public:
182-
friend class ApplicationCommands;
183-
184-
ApplicationCommandVector() noexcept = default;
185-
186-
operator std::vector<ApplicationCommand>();
187-
188-
ApplicationCommandVector(simdjson::ondemand::value jsonObjectData);
189-
190-
virtual ~ApplicationCommandVector() noexcept = default;
191-
192-
protected:
193-
std::vector<ApplicationCommand> applicationCommands{};
194-
};
195-
196161
/**@}*/
197162

198163
/**
@@ -267,25 +232,26 @@ namespace DiscordCoreAPI {
267232

268233
/// \brief Gets Guild ApplicationCommand permissions for a single server on this bot.
269234
/// \param dataPackage A GetGuildApplicationCommandPermissionsData structure.
270-
/// \returns A CoRoutine containing a vector<GuildApplicationCommandPermissionsData>.
235+
/// \returns A CoRoutine containing a vector<DiscordCoreAPI::GuildApplicationCommandPermissionsData>.
271236
static CoRoutine<std::vector<GuildApplicationCommandPermissionsData>> getGuildApplicationCommandPermissionsAsync(
272237
GetGuildApplicationCommandPermissionsData dataPackage);
273238

274239
/// \brief Get ApplicationCommand permissions for a single command on this bot.
275240
/// \param dataPackage A GetApplicationCommandPermissionsData structure.
276-
/// \returns A CoRoutine containing a GuildApplicationCommandPermissionsData.
241+
/// \returns A CoRoutine containing a DiscordCoreAPI::GuildApplicationCommandPermissionsData.
277242
static CoRoutine<GuildApplicationCommandPermissionsData> getApplicationCommandPermissionsAsync(
278243
GetApplicationCommandPermissionsData dataPackage);
279244

280245
/// \brief Edit Guild ApplicationCommand permissions for a server on this bot.
281246
/// \param dataPackage An EditGuildApplicationCommandPermissionsData structure.
282-
/// \returns A CoRoutine containing a GuildApplicationCommandPermissionsData.
247+
/// \returns A CoRoutine containing a DiscordCoreAPI::GuildApplicationCommandPermissionsData.
283248
static CoRoutine<GuildApplicationCommandPermissionsData> editGuildApplicationCommandPermissionsAsync(
284249
EditGuildApplicationCommandPermissionsData dataPackage);
285250

286251
protected:
287252
static DiscordCoreInternal::HttpsClient* httpsClient;
288253
};
254+
289255
/**@}*/
290256

291-
}// namespace DiscordCoreAPI
257+
}

Include/discordcoreapi/AudioDecoder.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
33
4-
Copyright 2021, 2022 Chris M. (RealTimeChris)
4+
Copyright 2021, 2022, 2023 Chris M. (RealTimeChris)
55
66
This library is free software; you can redistribute it and/or
77
modify it under the terms of the GNU Lesser General Public
@@ -43,7 +43,7 @@ namespace DiscordCoreInternal {
4343

4444
OpusDecoderWrapper();
4545

46-
std::basic_string_view<opus_int16> decodeData(std::basic_string_view<std::byte> dataToDecode);
46+
std::basic_string_view<opus_int16> decodeData(std::basic_string_view<uint8_t> dataToDecode);
4747

4848
protected:
4949
std::unique_ptr<OpusDecoder, OpusDecoderDeleter> ptr{ nullptr, OpusDecoderDeleter{} };
@@ -222,4 +222,4 @@ namespace DiscordCoreInternal {
222222
void cancelMe();
223223
};
224224

225-
}// namespace DiscordCoreAPI
225+
}

0 commit comments

Comments
 (0)