DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
GuildEntities.cpp
Go to the documentation of this file.
1/*
2 MIT License
3
4 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
5
6 Copyright 2022, 2023 Chris M. (RealTimeChris)
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25*/
26/// GuildEntities.cpp - Source file for the guild classes and structs.
27/// May 12, 2021
28/// https://discordcoreapi.com
29/// \file GuildEntities.cpp
30
39
40namespace jsonifier {
41
42 template<> struct core<discord_core_api::create_guild_data> {
43 using value_type = discord_core_api::create_guild_data;
44 static constexpr auto parseValue = createObject("default_message_notifications", &value_type::defaultMessageNotifications, "explicit_content_filter",
45 &value_type::explicitContentFilter, "system_channel_flags", &value_type::systemChannelFlags, "verification_level", &value_type::verificationLevel, "afk_timeout",
46 &value_type::afkTimeout, "region", &value_type::region, "name", &value_type::name, "icon", "channels", &value_type::channels, "system_channel_id",
47 &value_type::systemChannelId, "roles", &value_type::roles, "afk_channel_id", &value_type::afkChannelId);
48 };
49
50 template<> struct core<discord_core_api::modify_guild_data> {
51 using value_type = discord_core_api::modify_guild_data;
52 static constexpr auto parseValue =
53 createObject("default_message_notifications", &value_type::defaultMessageNotifications, "explicit_content_filter", &value_type::explicitContentFilter,
54 "system_channel_flags", &value_type::systemChannelFlags, "verification_level", &value_type::verificationLevel, "features", &value_type::features,
55 "public_updates_channel_id", &value_type::publicUpdatesChannelId, "afk_timeout", &value_type::afkTimeout, "preferred_locale", &value_type::preferredLocale,
56 "discovery_splash", &value_type::discoverySplash, "system_channel_id", &value_type::systemChannelId, "rules_channel_id", &value_type::rulesChannelId, "description",
57 &value_type::description, "afk_channel_id", &value_type::afkChannelId, "banner", &value_type::banner, "splash", &value_type::splash, "reason", &value_type::reason,
58 "owner_id", &value_type::ownerId, "guild_id", &value_type::guildId, "icon", &value_type::icon, "name", &value_type::name);
59 };
60
61 template<> struct core<discord_core_api::create_guild_ban_data> {
63 static constexpr auto parseValue = createObject("delete_message_days", &value_type::deleteMessageDays, "member", &value_type::guildMemberId, "reason", &value_type::reason,
64 "guild_id", &value_type::guildId);
65 };
66
67 template<> struct core<discord_core_api::modify_guild_welcome_screen_data> {
69 static constexpr auto parseValue = createObject("welcome_channels", &value_type::welcomeChannels, "description", &value_type::description, "guild_id", &value_type::guildId,
70 "enabled", &value_type::enabled, "reason", &value_type::reason);
71 };
72
73 template<> struct core<discord_core_api::get_guild_prune_count_data> {
75 static constexpr auto parseValue = createObject("include_roles", &value_type::includeRoles, "guild_id", &value_type::guildId, "days", &value_type::days);
76 };
77
78 template<> struct core<discord_core_api::begin_guild_prune_data> {
80 static constexpr auto parseValue = createObject("include_roles", &value_type::includeRoles, "compute_prune_count", &value_type::computePruneCount, "reason",
81 &value_type::reason, "guild_id", &value_type::guildId, "days", &value_type::days);
82 };
83
84 template<> struct core<discord_core_api::modify_guild_template_data> {
86 static constexpr auto parseValue =
87 createObject("template_code", &value_type::templateCode, "description", &value_type::description, "guild_id", &value_type::guildId, "name", &value_type::name);
88 };
89
90 template<> struct core<discord_core_api::create_guild_template_data> {
92 static constexpr auto parseValue = createObject("description", &value_type::description, "guild_id", &value_type::guildId, "name", &value_type::name);
93 };
94
95 template<> struct core<discord_core_api::create_guild_from_guild_template_data> {
97 static constexpr auto parseValue = createObject("template_code", &value_type::templateCode, "image_data", &value_type::imageData, "name", &value_type::name);
98 };
99
100 template<> struct core<discord_core_api::modify_guild_widget_data> {
102 static constexpr auto parseValue = createObject("widget_data", &value_type::widgetData, "reason", &value_type::reason, "guild_id", &value_type::guildId);
103 };
104
105
106}
107
108namespace discord_core_api {
109
110 guild_data::guild_data(snowflake newId) {
111 id = newId;
112 }
113
114 guild_cache_data::guild_cache_data(snowflake newId) {
115 id = newId;
116 }
117
118 discord_core_client* guild_cache_data::getDiscordCoreClient() {
119 return discord_core_client::getInstance();
120 }
121
122 discord_core_client* guild_data::getDiscordCoreClient() {
123 return discord_core_client::getInstance();
124 }
125
126 guild_cache_data& guild_cache_data::operator=(const guild_data& other) {
127 setFlagValue(guild_flags::Premium_Progress_Bar_Enabled, other.premiumProgressBarEnabled);
128 setFlagValue(guild_flags::Widget_enabled, other.widgetEnabled);
129 setFlagValue(guild_flags::Unavailable, other.unavailable);
130 setFlagValue(guild_flags::Large, other.large);
131 setFlagValue(guild_flags::Owner, other.owner);
132 if (discord_core_client::getInstance()) {
133 }
134 if (other.voiceConnection) {
135 voiceConnection = other.voiceConnection;
136 }
137 if (static_cast<int64_t>(other.flags) != 0) {
138 flags = other.flags;
139 }
140 for (auto& value: other.channels) {
141 channels.emplace_back(value.id);
142 }
143 for (auto& value: other.members) {
144 members.emplace_back(value.user.id);
145 }
146 for (auto& value: other.roles) {
147 roles.emplace_back(value.id);
148 }
149 for (auto& value: other.emoji) {
150 emoji.emplace_back(value.id);
151 }
152 if (other.discoverySplash != "") {
153 discoverySplash = other.discoverySplash;
154 }
155 if (other.memberCount != 0) {
156 memberCount = other.memberCount;
157 }
158 if (other.discovery != "") {
159 discovery = other.discovery;
160 }
161 if (other.ownerId != 0) {
162 ownerId = other.ownerId;
163 }
164 if (other.banner != "") {
165 banner = other.banner;
166 }
167 if (other.splash != "") {
168 splash = other.splash;
169 }
170 if (other.icon != "") {
171 icon = other.icon;
172 }
173 if (other.name != "") {
174 name = other.name;
175 }
176 if (other.id != 0) {
177 id = other.id;
178 }
179 return *this;
180 }
181
182 guild_cache_data::guild_cache_data(const guild_data& other) {
183 *this = other;
184 }
185
186 guild_cache_data& guild_cache_data::operator=(guild_data&& other) noexcept {
187 setFlagValue(guild_flags::Premium_Progress_Bar_Enabled, other.premiumProgressBarEnabled);
188 setFlagValue(guild_flags::Widget_enabled, other.widgetEnabled);
189 setFlagValue(guild_flags::Unavailable, other.unavailable);
190 setFlagValue(guild_flags::Large, other.large);
191 setFlagValue(guild_flags::Owner, other.owner);
192 if (other.discoverySplash != "") {
193 discoverySplash = std::move(other.discoverySplash);
194 }
195 if (other.voiceConnection) {
196 voiceConnection = other.voiceConnection;
197 }
198 if (static_cast<int64_t>(other.flags) != 0) {
199 flags = other.flags;
200 }
201 if (other.discovery != "") {
202 discovery = std::move(other.discovery);
203 }
204 for (auto& value: other.channels) {
205 channels.emplace_back(value.id);
206 }
207 for (auto& value: other.members) {
208 members.emplace_back(value.user.id);
209 }
210 for (auto& value: other.roles) {
211 roles.emplace_back(value.id);
212 }
213 for (auto& value: other.emoji) {
214 emoji.emplace_back(value.id);
215 }
216 if (other.memberCount != 0) {
217 memberCount = other.memberCount;
218 }
219 if (other.banner != "") {
220 banner = std::move(other.banner);
221 }
222 if (other.splash != "") {
223 splash = std::move(other.splash);
224 }
225 if (other.icon != "") {
226 icon = std::move(other.icon);
227 }
228 if (other.name != "") {
229 name = std::move(other.name);
230 }
231 if (other.ownerId != 0) {
232 ownerId = other.ownerId;
233 }
234 if (other.id != 0) {
235 id = other.id;
236 }
237 return *this;
238 }
239
240 guild_cache_data::operator guild_data() {
241 guild_data returnData{};
242 returnData.voiceConnection = voiceConnection;
243 for (auto& value: channels) {
244 if (channels::doWeCacheChannels()) {
245 returnData.channels.emplace_back(channels::getCachedChannel({ .channelId = value }));
246 } else {
247 channel_data newChannel{};
248 newChannel.id = value;
249 returnData.channels.emplace_back(newChannel);
250 }
251 }
252 for (auto& value: members) {
253 if (guild_members::doWeCacheGuildMembers()) {
254 returnData.members.emplace_back(guild_members::getCachedGuildMember({ .guildMemberId = value, .guildId = id }));
255 } else {
256 guild_member_data newChannel{};
257 newChannel.guildId = id;
258 newChannel.user.id = value;
259 returnData.members.emplace_back(newChannel);
260 }
261 }
262 for (auto& value: roles) {
263 if (roles::doWeCacheRoles()) {
264 returnData.roles.emplace_back(roles::getCachedRole({ .guildId = id, .roleId = value }));
265 } else {
266 role_data newChannel{};
267 newChannel.id = value;
268 returnData.roles.emplace_back(newChannel);
269 }
270 }
271 for (auto& value: emoji) {
272 emoji_data newValue{};
273 newValue.id = value;
274 returnData.emoji.emplace_back(std::move(newValue));
275 }
276 returnData.premiumProgressBarEnabled = getFlagValue(guild_flags::Premium_Progress_Bar_Enabled);
277 returnData.widgetEnabled = getFlagValue(guild_flags::Widget_enabled);
278 returnData.unavailable = getFlagValue(guild_flags::Unavailable);
279 returnData.large = getFlagValue(guild_flags::Large);
280 returnData.owner = getFlagValue(guild_flags::Owner);
281 returnData.discoverySplash = discoverySplash;
282 returnData.memberCount = memberCount;
283 returnData.discovery = discovery;
284 returnData.ownerId = ownerId;
285 returnData.banner = banner;
286 returnData.splash = splash;
287 returnData.flags = flags;
288 returnData.icon = icon;
289 returnData.name = name;
290 returnData.id = id;
291 return returnData;
292 }
293
294 guild_cache_data::guild_cache_data(guild_data&& other) noexcept {
295 *this = std::move(other);
296 }
297
298 modify_guild_data::modify_guild_data(const guild_data dataPackage) {
300 defaultMessageNotifications = dataPackage.defaultMessageNotifications;
301 publicUpdatesChannelId = dataPackage.publicUpdatesChannelId;
302 explicitContentFilter = dataPackage.explicitContentFilter;
303 systemChannelFlags = dataPackage.systemChannelFlags;
304 verificationLevel = dataPackage.verificationLevel;
305 preferredLocale = dataPackage.preferredLocale;
306 systemChannelId = dataPackage.systemChannelId;
307 rulesChannelId = dataPackage.rulesChannelId;
308 afkChannelId = dataPackage.afkChannelId;
309 description = dataPackage.description;
310 for (auto& value: dataPackage.features) {
311 features.emplace_back(value);
312 }
313 ownerId = dataPackage.ownerId;
314 guildId = dataPackage.id;
315 name = dataPackage.name;
316 }
317
318 void guilds::initialize(discord_core_internal::https_client* client, config_manager* configManagerNew) {
319 guilds::doWeCacheGuildsBool = configManagerNew->doWeCacheGuilds();
320 guilds::httpsClient = client;
321 stopWatchNew.reset();
322 }
323
325 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Audit_Logs };
326 co_await newThreadAwaitable<audit_log_data>();
327 workload.workloadClass = discord_core_internal::https_workload_class::Get;
328 workload.relativePath = "/guilds/" + dataPackage.guildId + "/audit-logs";
329 if (dataPackage.userId != 0) {
330 workload.relativePath += "?user_id=" + dataPackage.userId;
331 if (jsonifier::toString(static_cast<uint64_t>(dataPackage.actionType)) != "") {
332 workload.relativePath += "&action_type=" + jsonifier::toString(static_cast<uint64_t>(dataPackage.actionType));
333 }
334 if (dataPackage.limit != 0) {
335 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
336 }
337 if (dataPackage.before != 0) {
338 workload.relativePath += "&before=" + dataPackage.before;
339 }
340 } else if (jsonifier::toString(static_cast<uint64_t>(dataPackage.actionType)) != "") {
341 workload.relativePath += "?action_type=" + jsonifier::toString(static_cast<uint64_t>(dataPackage.actionType));
342 if (dataPackage.limit != 0) {
343 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
344 }
345 if (dataPackage.before != 0) {
346 workload.relativePath += "&before=" + dataPackage.before;
347 }
348 } else if (dataPackage.limit != 0) {
349 workload.relativePath += "?limit=" + jsonifier::toString(dataPackage.limit);
350 if (dataPackage.before != 0) {
351 workload.relativePath += "&before=" + dataPackage.before;
352 }
353 } else if (dataPackage.before != 0) {
354 workload.relativePath += "?before=" + dataPackage.before;
355 }
356 workload.callStack = "guilds::getAuditLogDataAsync()";
357 audit_log_data returnData{};
358 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
359 co_return returnData;
360 }
361
363 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild };
364 co_await newThreadAwaitable<guild_data>();
365 workload.workloadClass = discord_core_internal::https_workload_class::Post;
366 workload.relativePath = "/guilds";
367 parser.serializeJson<true>(dataPackage, workload.content);
368 workload.callStack = "guilds::createGuildAsync()";
369 guild_data returnData{};
370 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
371 co_return returnData;
372 }
373
374 jsonifier::vector<guild_data> guilds::getAllGuildsAsync() {
375 jsonifier::vector<guild_data> returnData{};
376 for (auto& value: guilds::cache) {
377 returnData.emplace_back(*value);
378 }
379 return returnData;
380 }
381
383 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild };
384 co_await newThreadAwaitable<guild_data>();
385 workload.workloadClass = discord_core_internal::https_workload_class::Get;
386 workload.relativePath = "/guilds/" + dataPackage.guildId + "?with_counts=true";
387 workload.callStack = "guilds::getGuildAsync()";
388 guild_data data{ dataPackage.guildId };
389 ;
390 if (cache.contains(data.id)) {
391 data = cache[data.id];
392 }
393 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), data);
394 if (doWeCacheGuildsBool) {
395 insertGuild(static_cast<guild_cache_data>(data));
396 }
397 co_return data;
398 }
399
401 if (guilds::cache.contains(dataPackage.guildId)) {
402 return cache[dataPackage.guildId];
403 } else {
404 return getGuildAsync({ .guildId = dataPackage.guildId }).get();
405 }
406 }
407
409 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Preview };
410 co_await newThreadAwaitable<guild_preview_data>();
411 workload.workloadClass = discord_core_internal::https_workload_class::Get;
412 workload.relativePath = "/guilds/" + dataPackage.guildId + "/preview";
413 workload.callStack = "guilds::getGuildPreviewAsync()";
414 guild_preview_data returnData{};
415 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
416 co_return returnData;
417 }
418
420 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild };
421 co_await newThreadAwaitable<guild_data>();
422 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
423 workload.relativePath = "/guilds/" + dataPackage.guildId;
424 parser.serializeJson<true>(dataPackage, workload.content);
425 workload.callStack = "guilds::modifyGuildAsync()";
426 if (dataPackage.reason != "") {
427 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
428 }
429 guild_data data{ dataPackage.guildId };
430 if (cache.contains(data.id)) {
431 data = cache[data.id];
432 }
433 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), data);
434 if (doWeCacheGuildsBool) {
435 insertGuild(static_cast<guild_cache_data>(data));
436 }
437 co_return data;
438 }
439
441 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild };
442 co_await newThreadAwaitable<void>();
443 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
444 workload.relativePath = "/guilds/" + dataPackage.guildId;
445 workload.callStack = "guilds::deleteGuildAsync()";
446 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
447 co_return;
448 }
449
451 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Bans };
452 co_await newThreadAwaitable<jsonifier::vector<ban_data>>();
453 workload.workloadClass = discord_core_internal::https_workload_class::Get;
454 workload.relativePath = "/guilds/" + dataPackage.guildId + "/bans";
455 if (dataPackage.after != 0) {
456 workload.relativePath += "?after=" + dataPackage.after;
457 if (dataPackage.before != 0) {
458 workload.relativePath += "&before=" + dataPackage.before;
459 }
460 if (dataPackage.limit != 0) {
461 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
462 }
463 } else if (dataPackage.before != 0) {
464 workload.relativePath += "?before=" + dataPackage.before;
465 if (dataPackage.limit != 0) {
466 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
467 }
468 } else if (dataPackage.limit != 0) {
469 workload.relativePath += "?limit=" + jsonifier::toString(dataPackage.limit);
470 }
471 workload.callStack = "guilds::getGuildBansAsync()";
472 jsonifier::vector<ban_data> returnData{};
473 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
474 co_return returnData;
475 }
476
478 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Ban };
479 co_await newThreadAwaitable<ban_data>();
480 workload.workloadClass = discord_core_internal::https_workload_class::Get;
481 workload.relativePath = "/guilds/" + dataPackage.guildId + "/bans/" + dataPackage.userId;
482 workload.callStack = "guilds::getGuildBanAsync()";
483 ban_data data{};
484 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), data);
485 co_return std::move(data);
486 }
487
489 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Put_Guild_Ban };
490 co_await newThreadAwaitable<void>();
491 workload.workloadClass = discord_core_internal::https_workload_class::Put;
492 workload.relativePath = "/guilds/" + dataPackage.guildId + "/bans/" + dataPackage.guildMemberId;
493 parser.serializeJson<true>(dataPackage, workload.content);
494 workload.callStack = "guilds::createGuildBanAsync()";
495 if (dataPackage.reason != "") {
496 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
497 }
498 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
499 co_return;
500 }
501
503 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild_Ban };
504 co_await newThreadAwaitable<void>();
505 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
506 workload.relativePath = "/guilds/" + dataPackage.guildId + "/bans/" + dataPackage.userId;
507 workload.callStack = "guilds::removeGuildBanAsync()";
508 if (dataPackage.reason != "") {
509 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
510 }
511 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
512 co_return;
513 }
514
516 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Prune_Count };
517 co_await newThreadAwaitable<guild_prune_count_data>();
518 workload.workloadClass = discord_core_internal::https_workload_class::Get;
519 workload.relativePath = "/guilds/" + dataPackage.guildId + "/prune";
520 workload.callStack = "guilds::getGuildPruneCountAsync()";
521 if (dataPackage.days != 0) {
522 workload.relativePath += "?days=" + jsonifier::toString(dataPackage.days);
523 if (dataPackage.includeRoles.size() > 0) {
524 workload.relativePath += "&include_roles=";
525 for (uint64_t x = 0; x < dataPackage.includeRoles.size(); ++x) {
526 workload.relativePath += dataPackage.includeRoles.at(x).operator jsonifier::string();
527 if (x < dataPackage.includeRoles.size() - 1) {
528 workload.relativePath += ",";
529 }
530 }
531 }
532 } else if (dataPackage.includeRoles.size() > 0) {
533 workload.relativePath += "?include_roles=";
534 for (uint64_t x = 0; x < dataPackage.includeRoles.size(); ++x) {
535 workload.relativePath += dataPackage.includeRoles.at(x).operator jsonifier::string();
536 if (x < dataPackage.includeRoles.size() - 1) {
537 workload.relativePath += ",";
538 }
539 }
540 }
541 guild_prune_count_data returnData{};
542 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
543 co_return returnData;
544 }
545
547 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild_Prune };
548 co_await newThreadAwaitable<guild_prune_count_data>();
549 workload.workloadClass = discord_core_internal::https_workload_class::Post;
550 workload.relativePath = "/guilds/" + dataPackage.guildId + "/prune";
551 parser.serializeJson<true>(dataPackage, workload.content);
552 workload.callStack = "guilds::beginGuildPruneAsync()";
553 if (dataPackage.reason != "") {
554 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
555 }
556 guild_prune_count_data returnData{};
557 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
558 co_return returnData;
559 }
560
562 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Voice_Regions };
563 co_await newThreadAwaitable<jsonifier::vector<voice_region_data>>();
564 workload.workloadClass = discord_core_internal::https_workload_class::Get;
565 workload.relativePath = "/guilds/" + dataPackage.guildId + "/regions";
566 workload.callStack = "guilds::getGuildVoiceRegionsAsync()";
567 jsonifier::vector<voice_region_data> returnData{};
568 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
569 co_return returnData;
570 }
571
573 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Invites };
574 co_await newThreadAwaitable<jsonifier::vector<invite_data>>();
575 workload.workloadClass = discord_core_internal::https_workload_class::Get;
576 workload.relativePath = "/guilds/" + dataPackage.guildId + "/invites";
577 workload.callStack = "guilds::getGuildInvitesAsync()";
578 jsonifier::vector<invite_data> returnData{};
579 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
580
581 co_return returnData;
582 }
583
585 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Integrations };
586 co_await newThreadAwaitable<jsonifier::vector<integration_data>>();
587 workload.workloadClass = discord_core_internal::https_workload_class::Get;
588 workload.relativePath = "/guilds/" + dataPackage.guildId + "/integrations";
589 workload.callStack = "guilds::getGuildIntegrationsAsync()";
590 jsonifier::vector<integration_data> returnData{};
591 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
592 co_return returnData;
593 }
594
596 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild_Integration };
597 co_await newThreadAwaitable<void>();
598 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
599 workload.relativePath = "/guilds/" + dataPackage.guildId + "/integrations/" + dataPackage.integrationId;
600 workload.callStack = "guilds::deleteGuildIntegrationAsync()";
601 if (dataPackage.reason != "") {
602 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
603 }
604 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
605 co_return;
606 }
607
609 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Widget_Settings };
610 co_await newThreadAwaitable<guild_widget_data>();
611 workload.workloadClass = discord_core_internal::https_workload_class::Get;
612 workload.relativePath = "/guilds/" + dataPackage.guildId + "/widget";
613 workload.callStack = "guilds::getGuildWidgetSettingsAsync()";
614 guild_widget_data returnData{};
615 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
616 co_return returnData;
617 }
618
620 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild_Widget };
621 co_await newThreadAwaitable<guild_widget_data>();
622 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
623 workload.relativePath = "/guilds/" + dataPackage.guildId + "/widget";
624 parser.serializeJson<true>(dataPackage, workload.content);
625 workload.callStack = "guilds::modifyGuildWidgetAsync()";
626 if (dataPackage.reason != "") {
627 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
628 }
629 guild_widget_data returnData{};
630 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
631 co_return returnData;
632 }
633
635 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Widget };
636 co_await newThreadAwaitable<guild_widget_data>();
637 workload.workloadClass = discord_core_internal::https_workload_class::Get;
638 workload.relativePath = "/guilds/" + dataPackage.guildId + "/widget.json";
639 workload.callStack = "guilds::getGuildWidgetAsync()";
640 guild_widget_data returnData{};
641 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
642 co_return returnData;
643 }
644
646 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Vanity_Invite };
647 co_await newThreadAwaitable<invite_data>();
648 workload.workloadClass = discord_core_internal::https_workload_class::Get;
649 workload.relativePath = "/guilds/" + dataPackage.guildId + "/vanity-url";
650 workload.callStack = "guilds::getGuildVanityInviteAsync()";
651 invite_data returnData{};
652 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
653 co_return returnData;
654 }
655
657 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Widget_Image };
658 co_await newThreadAwaitable<guild_widget_image_data>();
659 workload.workloadClass = discord_core_internal::https_workload_class::Get;
660 workload.relativePath = "/guilds/" + dataPackage.guildId + "/widget.png";
661 switch (dataPackage.widgetStlye) {
663 workload.relativePath += "?style=shield";
664 break;
665 }
667 workload.relativePath += "?style=banner1";
668 break;
669 }
671 workload.relativePath += "?style=banner2";
672 break;
673 }
675 workload.relativePath += "?style=banner3";
676 break;
677 }
679 workload.relativePath += "?style=banner4";
680 break;
681 }
682 }
683 workload.callStack = "guilds::getGuildWidgetImageAsync()";
684 guild_widget_image_data returnData{};
685 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
686 co_return returnData;
687 }
688
690 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Welcome_Screen };
691 co_await newThreadAwaitable<welcome_screen_data>();
692 workload.workloadClass = discord_core_internal::https_workload_class::Get;
693 workload.relativePath = "/guilds/" + dataPackage.guildId + "/welcome-screen";
694 workload.callStack = "guilds::getGuildWelcomeScreenAsync()";
695 welcome_screen_data returnData{};
696 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
697 co_return returnData;
698 }
699
701 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild_Welcome_Screen };
702 co_await newThreadAwaitable<welcome_screen_data>();
703 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
704 workload.relativePath = "/guilds/" + dataPackage.guildId + "/welcome-screen";
705 parser.serializeJson<true>(dataPackage, workload.content);
706 workload.callStack = "guilds::modifyGuildWelcomeScreenAsync()";
707 if (dataPackage.reason != "") {
708 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
709 }
710 welcome_screen_data returnData{};
711 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
712 co_return returnData;
713 };
714
716 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Template };
717 co_await newThreadAwaitable<guild_template_data>();
718 workload.workloadClass = discord_core_internal::https_workload_class::Get;
719 workload.relativePath = "/guilds/templates/" + dataPackage.templateCode;
720 workload.callStack = "guilds::getGuildTemplateAsync()";
721 guild_template_data returnData{};
722 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
723 co_return returnData;
724 }
725
727 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild_From_Guild_Template };
728 co_await newThreadAwaitable<guild_data>();
729 workload.workloadClass = discord_core_internal::https_workload_class::Post;
730 workload.relativePath = "/guilds/templates/" + dataPackage.templateCode;
731 parser.serializeJson<true>(dataPackage, workload.content);
732 workload.callStack = "guilds::createGuildFromGuildTemplateAsync()";
733 guild_data returnData{};
734 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
735 co_return returnData;
736 }
737
739 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Templates };
740 co_await newThreadAwaitable<jsonifier::vector<guild_template_data>>();
741 workload.workloadClass = discord_core_internal::https_workload_class::Get;
742 workload.relativePath = "/guilds/" + dataPackage.guildId + "/templates";
743 workload.callStack = "guilds::getGuildTemplatesAsync()";
744 jsonifier::vector<guild_template_data> returnData{};
745 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
746 co_return returnData;
747 }
748
750 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild_Template };
751 co_await newThreadAwaitable<guild_template_data>();
752 workload.workloadClass = discord_core_internal::https_workload_class::Post;
753 workload.relativePath = "/guilds/" + dataPackage.guildId + "/templates";
754 parser.serializeJson<true>(dataPackage, workload.content);
755 workload.callStack = "guilds::createGuildTemplateAsync()";
756 guild_template_data returnData{};
757 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
758 co_return returnData;
759 }
760
762 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Put_Guild_Template };
763 co_await newThreadAwaitable<guild_template_data>();
764 workload.workloadClass = discord_core_internal::https_workload_class::Put;
765 workload.relativePath = "/guilds/" + dataPackage.guildId + "/templates/" + dataPackage.templateCode;
766 workload.callStack = "guilds::syncGuildTemplateAsync()";
767 guild_template_data returnData{};
768 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
769 co_return returnData;
770 }
771
773 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild_Template };
774 co_await newThreadAwaitable<guild_template_data>();
775 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
776 workload.relativePath = "/guilds/" + dataPackage.guildId + "/templates/" + dataPackage.templateCode;
777 parser.serializeJson<true>(dataPackage, workload.content);
778 workload.callStack = "guilds::modifyGuildTemplateAsync()";
779 guild_template_data returnData{};
780 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
781 co_return returnData;
782 }
783
785 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild_Template };
786 co_await newThreadAwaitable<void>();
787 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
788 workload.relativePath = "/guilds/" + dataPackage.guildId + "/templates/" + dataPackage.templateCode;
789 workload.callStack = "guilds::deleteGuildTemplateAsync()";
790 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
791 co_return;
792 }
793
795 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Invite };
796 co_await newThreadAwaitable<invite_data>();
797 workload.workloadClass = discord_core_internal::https_workload_class::Get;
798 workload.relativePath = "/invites/" + dataPackage.inviteId;
799 if (dataPackage.withCount) {
800 workload.relativePath += "?with_counts=true";
801 if (dataPackage.withExpiration) {
802 workload.relativePath += "&with_expiration=true";
803 }
804 if (dataPackage.guildScheduledEventId != 0) {
805 workload.relativePath += "&guild_scheduled_event_id=" + dataPackage.guildScheduledEventId;
806 }
807 } else if (dataPackage.withExpiration) {
808 workload.relativePath += "?with_expiration=true";
809 if (dataPackage.guildScheduledEventId != 0) {
810 workload.relativePath += "&guild_scheduled_event_id=" + dataPackage.guildScheduledEventId;
811 }
812 } else if (dataPackage.guildScheduledEventId != 0) {
813 workload.relativePath += "?guild_scheduled_event_id=" + dataPackage.guildScheduledEventId;
814 }
815
816 workload.callStack = "guilds::getInviteAsync()";
817 invite_data returnData{};
818 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
819 co_return returnData;
820 }
821
823 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Invite };
824 co_await newThreadAwaitable<void>();
825 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
826 workload.relativePath = "/invites/" + dataPackage.inviteId;
827 workload.callStack = "guilds::deleteInviteAsync()";
828 if (dataPackage.reason != "") {
829 workload.headersToInsert["x-audit-log-reason"] = dataPackage.reason;
830 }
831 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
832 co_return;
833 }
834
836 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Current_User_Guilds };
837 co_await newThreadAwaitable<jsonifier::vector<guild_data>>();
838 workload.workloadClass = discord_core_internal::https_workload_class::Get;
839 workload.relativePath = "/users/@me/guilds";
840 if (dataPackage.after != 0) {
841 workload.relativePath += "?after=" + dataPackage.after;
842 if (dataPackage.before != 0) {
843 workload.relativePath += "&before=" + dataPackage.before;
844 }
845 if (dataPackage.limit != 0) {
846 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
847 }
848 } else if (dataPackage.before != 0) {
849 workload.relativePath += "?before=" + dataPackage.before;
850 if (dataPackage.limit != 0) {
851 workload.relativePath += "&limit=" + jsonifier::toString(dataPackage.limit);
852 }
853 } else if (dataPackage.limit != 0) {
854 workload.relativePath += "?limit=" + jsonifier::toString(dataPackage.limit);
855 }
856 workload.callStack = "users::getCurrentUserGuildsAsync()";
857 jsonifier::vector<guild_data> returnData{};
858 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
859 co_return returnData;
860 }
861
863 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Leave_Guild };
864 co_await newThreadAwaitable<void>();
865 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
866 workload.relativePath = "/users/@me/guilds/" + dataPackage.guildId;
867 workload.callStack = "guilds::leaveGuildAsync()";
868 guilds::httpsClient->submitWorkloadAndGetResult(std::move(workload));
869 co_return;
870 }
871
872 object_cache<guild_cache_data>& guilds::getCache() {
873 return guilds::cache;
874 }
875
876 void guilds::removeGuild(const guild_cache_data& guildId) {
877 guilds::cache.erase(guildId);
878 };
879
880 bool guilds::doWeCacheGuilds() {
881 return guilds::doWeCacheGuildsBool;
882 }
883
884 discord_core_internal::https_client* guilds::httpsClient{};
885 object_cache<guild_cache_data> guilds::cache{};
886 bool guilds::doWeCacheGuildsBool{};
887
888}
static channel_cache_data getCachedChannel(const get_channel_data dataPackage)
Collects a channel from the library's cache.
A co_routine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:83
Data structure representing a single guild, for the purposes of populating the cache.
jsonifier::vector< snowflake > members
Array of guild_members.
jsonifier::vector< snowflake > channels
Array of guild channels.
icon_hash icon
Url to the guild's icon.
icon_hash discoverySplash
Url to the guild's icon.
snowflake ownerId
User_data id of the guild's owner.
voice_connection * voiceConnection
A pointer to the voice_connection, if present.
icon_hash splash
Url to the guild's icon.
jsonifier::vector< snowflake > emoji
Array of guild channels.
jsonifier::string name
The guild's name.
jsonifier::vector< snowflake > roles
Array of guild roles.
icon_hash discovery
Url to the guild's icon.
icon_hash banner
Url to the guild's icon.
A discord guild. used to connect to/disconnect from voice.
static guild_member_cache_data getCachedGuildMember(const get_guild_member_data dataPackage)
Collects a guild_member from the library's cache.
static co_routine< void > deleteGuildAsync(const delete_guild_data dataPackage)
Deletes a chosen guild.
static co_routine< jsonifier::vector< guild_data > > getCurrentUserGuildsAsync(const get_current_user_guilds_data dataPackage)
Collects a list of guilds that the bot is in.
static co_routine< guild_widget_data > getGuildWidgetSettingsAsync(const get_guild_widget_settings_data dataPackage)
Gets the guild widget's settings for a particular server.
static co_routine< welcome_screen_data > modifyGuildWelcomeScreenAsync(const modify_guild_welcome_screen_data dataPackage)
Modifies the guild welcome screen.
static co_routine< guild_data > createGuildFromGuildTemplateAsync(const create_guild_from_guild_template_data dataPackage)
Creates a guild from the guild template.
static co_routine< jsonifier::vector< guild_template_data > > getGuildTemplatesAsync(const get_guild_templates_data dataPackage)
Collects a list of guild templates from a chosen guild.
static co_routine< guild_widget_data > getGuildWidgetAsync(const get_guild_widget_data dataPackage)
Gets the guild widget for a particular server.
static co_routine< guild_data > getGuildAsync(const get_guild_data dataPackage)
Collects a guild from the discord servers.
static co_routine< guild_prune_count_data > getGuildPruneCountAsync(const get_guild_prune_count_data dataPackage)
For collecting the guild prune count.
static co_routine< jsonifier::vector< integration_data > > getGuildIntegrationsAsync(const get_guild_integrations_data dataPackage)
Gets the list of guild integrations for a particular server.
static co_routine< guild_template_data > modifyGuildTemplateAsync(const modify_guild_template_data dataPackage)
Modifies a guild template.
static co_routine< void > removeGuildBanAsync(const remove_guild_ban_data dataPackage)
Removes a previously created ban.
static jsonifier::vector< guild_data > getAllGuildsAsync()
Returns all of the guilds that the current bot is in.
static co_routine< audit_log_data > getGuildAuditLogsAsync(const get_guild_audit_logs_data dataPackage)
Gets an audit log from the discord servers.
static co_routine< welcome_screen_data > getGuildWelcomeScreenAsync(const get_guild_welcome_screen_data dataPackage)
Gets the guild welcome screen for a particular server.
static co_routine< void > deleteGuildTemplateAsync(const delete_guild_template_data dataPackage)
Deletes a guild template.
static co_routine< void > leaveGuildAsync(const leave_guild_data dataPackage)
Removes the bot from a chosen guild.
static co_routine< invite_data > getGuildVanityInviteAsync(const get_guild_vanity_invite_data dataPackage)
Gets the vanity invite responseData from a particular server.
static co_routine< jsonifier::vector< invite_data > > getGuildInvitesAsync(const get_guild_invites_data dataPackage)
Gets multiple invites from the discord servers.
static co_routine< guild_data > modifyGuildAsync(const modify_guild_data dataPackage)
Modifies a chosen guild's properties.
static co_routine< void > createGuildBanAsync(const create_guild_ban_data dataPackage)
Bans a guild_member.
static co_routine< ban_data > getGuildBanAsync(const get_guild_ban_data dataPackage)
Collects a single ban from a chosen guild.
static co_routine< guild_widget_image_data > getGuildWidgetImageAsync(const get_guild_widget_image_data dataPackage)
Gets the guild widget image for a particular server.
static co_routine< void > deleteGuildIntegrationAsync(const delete_guild_integration_data dataPackage)
Deletes an integration from a guild.
static guild_cache_data getCachedGuild(const get_guild_data dataPackage)
Collects a guild from the library's cache.
static co_routine< guild_preview_data > getGuildPreviewAsync(const get_guild_preview_data dataPackage)
Acquires the preview data of a chosen guild.
static co_routine< jsonifier::vector< ban_data > > getGuildBansAsync(const get_guild_bans_data dataPackage)
Collects a list of bans from a chosen guild.
static co_routine< guild_template_data > getGuildTemplateAsync(const get_guild_template_data dataPackage)
Gets the guild template from a particular server.
static co_routine< guild_data > createGuildAsync(const create_guild_data dataPackage)
Creates a new guild.
static co_routine< invite_data > getInviteAsync(const get_invite_data dataPackage)
Gets an invite from the discord servers.
static co_routine< guild_template_data > syncGuildTemplateAsync(const sync_guild_template_data dataPackage)
Syncs a guild template.
static co_routine< jsonifier::vector< voice_region_data > > getGuildVoiceRegionsAsync(const get_guild_voice_regions_data dataPackage)
Gets the list of voice regions for a particular server.
static co_routine< guild_template_data > createGuildTemplateAsync(const create_guild_template_data dataPackage)
Creates a guild template.
static co_routine< void > deleteInviteAsync(const delete_invite_data dataPackage)
Deletes an invite from the discord servers.
static co_routine< guild_widget_data > modifyGuildWidgetAsync(const modify_guild_widget_data dataPackage)
Modifies the guild widget for a particular server.
static co_routine< guild_prune_count_data > beginGuildPruneAsync(const begin_guild_prune_data dataPackage)
For performing a pruning of the guild_members of the guild, based on days of inactivity.
A template class representing an object cache.
Definition: ObjectCache.hpp:40
void erase(mapped_type_new &&key)
Remove an object from the cache using a key.
static role_cache_data getCachedRole(const get_role_data dataPackage)
Collects a given role from the library's cache.
uint64_t id
The snowflake id.
Definition: Base.hpp:811
@ Large
Is it a large guild?
@ Widget_enabled
Widget enabled.
@ Premium_Progress_Bar_Enabled
Premium progress bar enabled.
The main namespace for the forward-facing interfaces.
For pruning a number of guild_members from the guild.
snowflake guildId
Guild within which to perform the prune.
jsonifier::string reason
whether 'pruned' is returned, discouraged for large guilds.
For banning a current guild_member_data.
jsonifier::string reason
The reason for the ban.
snowflake guildId
The id of the guild from which to ban the member.
snowflake guildMemberId
The id of the member to be banned.
For creating a guild from a guild template.
jsonifier::string templateCode
code for the desired template to use.
snowflake guildId
Guild within which you wuold like to create the template.
snowflake guildId
The guild you would like to delete.
jsonifier::string reason
Reason for deleting the integration.
snowflake guildId
The guild from which to delete the integration from.
snowflake integrationId
The integration's id which we are going to delete.
snowflake guildId
The guild within which you would like to delete the template.
jsonifier::string templateCode
The template which you would like to delete.
For deleting a single guild invite.
snowflake inviteId
The invite which you would like to delete.
jsonifier::string reason
Reason for deleting the invite.
For collecting a list of guild's that the bot is in.
uint32_t limit
Max number of guilds to return (1 - 200).
snowflake before
Get guilds before this guild id.
snowflake after
Get guilds after this guild id.
For geting a guild's audit logs.
int32_t limit
The maximum number of actions to acquire from the log.
audit_log_event actionType
The action type to acquire audit-logs for.
snowflake guildId
The guiild id for the guild which you wish to query the log of.
snowflake userId
The user_data for whom to look for the actions of.
snowflake before
Entries that preceded a specific audit log entry id.
For getting a single guild ban.
snowflake guildId
The guild from which to collect the ban from.
snowflake userId
The user_data for whom to collect the ban of.
For getting a list of guild bans.
snowflake guildId
The guild from which to collect the list of bans.
snowflake after
consider only users after given user id null.
snowflake before
consider only users before given user id.
uint64_t limit
Number of users to return ( up to maximum 1000 ).
For getting a guild from the library's cache or a discord server.
snowflake guildId
The id of the guild to acquire.
For geting all of the current invites from a guild.
snowflake guildId
The id of the guild you wish to acquire.
For acquiring a guild preview of a chosen guild.
snowflake guildId
The id of the guild's preview to acquire.
For collecting the guild prune count.
snowflake guildId
The guild to be pruned.
int32_t days
The number of days beyond which to prune the user's for inactivity.
jsonifier::vector< snowflake > includeRoles
Roles to be included in the prune.
For collecting a guild's template.
jsonifier::string templateCode
code for the desired template.
For collecting a list of guild templates from a chosen guild.
snowflake guildId
Guild from which you would like to collect the templates from.
For geting the vanity invite responseData of a guild.
snowflake guildId
The id of the guild to acquire the vanity invite from.
For collecting a list of guild voice regions.
snowflake guildId
The guild for which to collect the voice regions from.
For collecting a guild's welcome screen.
snowflake guildId
The guild for which to collect the widget image from.
For collecting a guild's widget.
snowflake guildId
The guild from which to collect the widget from.
For collecting a guild's widget image.
widget_style_options widgetStlye
The style of widget image to collect.
snowflake guildId
The guild for which to collect the widget image from.
For collecting a guild's widget settings.
snowflake guildId
The guild from which to collect the widget from.
For geting a single invite's responseData from a guild.
snowflake guildScheduledEventId
The guild scheduled event to include with the invite.
snowflake inviteId
The id of the invite you wish to acquire.
bool withCount
collect usage etc counts?
bool withExpiration
collect expiration time/date?
Data representing a single guild preview.
For leaving a particular guild.
snowflake guildId
The id of the guild you would like the bot to leave.
For modifying the properties of a chosen guild.
snowflake guildId
snowflake of the chosen guild to modify.
jsonifier::vector< jsonifier::string > features
Array of guild feature strings enabled guild features.
system_channel_flags systemChannelFlags
System channel_data flags.
snowflake systemChannelId
base64 16 : 9 png / jpeg image for the guild discovery splash(when the server has the discoverable fe...
jsonifier::string name
Desired name of the guild.
verification_level verificationLevel
Verification level.
snowflake afkChannelId
snowflake for afk channels.
snowflake ownerId
User_data id to transfer guild ownership to (must be owner).
jsonifier::string reason
Reason for modifying the guild.
jsonifier::string description
The description for the guild, if the guild is discoverable.
explicit_content_filter_level explicitContentFilter
Explicit content filter level.
snowflake rulesChannelId
The id of the channel_data where community guilds display rules and /or guidelines.
bool premiumProgressBarEnabled
Whether or not the progress bar is enabled.
jsonifier::string preferredLocale
The preferred locale of a community guild used in server discovery.
default_message_notification_level defaultMessageNotifications
Default message notification level.
snowflake publicUpdatesChannelId
The id of the channel_data where admins and moderators of community guilds receive notices from disco...
snowflake guildId
Guild within which you would like to modify the template.
For modifying a guild's welcome screen.
jsonifier::string reason
The reason for modifying the welcome screen.
snowflake guildId
The guild for which to modify the welcome screen of.
For modifying a guild's widget.
jsonifier::string reason
Reason for modifying the widget.
snowflake guildId
The guild for which to modify the widget of.
For removing a previous created ban.
jsonifier::string reason
The reason for removing this ban.
snowflake guildId
The guild from which to erase the ban.
snowflake userId
The user snowflake of the user who's ban to erase.
snowflake guildId
Guild for which you would like to sync the template of.
jsonifier::string templateCode
Template code for which template you would like to sync.