33 static constexpr auto parseValue = object(
"description", &ValueType::description,
"reason", &ValueType::reason,
"guildId",
34 &ValueType::guildId,
"file", &ValueType::file,
"name", &ValueType::name,
"tags", &ValueType::tags);
39 static constexpr auto parseValue = object(
"description", &ValueType::description,
"stickerId", &ValueType::stickerId,
"reason",
40 &ValueType::reason,
"guildId", &ValueType::guildId,
"name", &ValueType::name,
"tags", &ValueType::tags);
47 void Stickers::initialize(DiscordCoreInternal::HttpsClient* client) {
48 Stickers::httpsClient = client;
52 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Get_Sticker };
53 co_await NewThreadAwaitable<Sticker>();
54 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Get;
55 workload.relativePath =
"/stickers/" + dataPackage.
stickerId;
56 workload.callStack =
"Stickers::getStickerAsync()";
58 Stickers::httpsClient->submitWorkloadAndGetResult<
Sticker>(workload, returnData);
63 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Get_Nitro_Sticker_Packs };
64 co_await NewThreadAwaitable<std::vector<StickerPackData>>();
65 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Get;
66 workload.relativePath =
"/sticker-packs";
67 workload.callStack =
"Stickers::getNitroStickerPacksAsync()";
68 StickerPackDataVector returnData{};
69 Stickers::httpsClient->submitWorkloadAndGetResult<StickerPackDataVector>(workload, returnData);
74 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Get_Guild_Stickers };
75 co_await NewThreadAwaitable<std::vector<Sticker>>();
76 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Get;
77 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers";
78 workload.callStack =
"Stickers::getGuildStickersAsync()";
79 StickerVector returnData{};
80 Stickers::httpsClient->submitWorkloadAndGetResult<StickerVector>(workload, returnData);
85 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Post_Guild_Sticker };
86 co_await NewThreadAwaitable<Sticker>();
87 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Post;
88 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers";
89 Jsonifier::JsonifierCore parser{};
90 parser.serializeJson(dataPackage, workload.content);
91 workload.callStack =
"Stickers::createGuildStickerAsync()";
92 if (dataPackage.
reason !=
"") {
93 workload.headersToInsert[
"X-Audit-Log-Reason"] = dataPackage.
reason;
96 Stickers::httpsClient->submitWorkloadAndGetResult<
Sticker>(workload, returnData);
101 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Patch_Guild_Sticker };
102 co_await NewThreadAwaitable<Sticker>();
103 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Patch;
104 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers/" + dataPackage.
stickerId;
105 Jsonifier::JsonifierCore parser{};
106 parser.serializeJson(dataPackage, workload.content);
107 workload.callStack =
"Stickers::modifyGuildStickerAsync()";
108 if (dataPackage.
reason !=
"") {
109 workload.headersToInsert[
"X-Audit-Log-Reason"] = dataPackage.
reason;
112 Stickers::httpsClient->submitWorkloadAndGetResult<
Sticker>(workload, returnData);
113 co_return returnData;
117 DiscordCoreInternal::HttpsWorkloadData workload{ DiscordCoreInternal::HttpsWorkloadType::Delete_Guild_Sticker };
118 co_await NewThreadAwaitable<void>();
119 workload.workloadClass = DiscordCoreInternal::HttpsWorkloadClass::Delete;
120 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers/" + dataPackage.
stickerId;
121 workload.callStack =
"Stickers::deleteGuildStickerAsync()";
122 if (dataPackage.
reason !=
"") {
123 workload.headersToInsert[
"X-Audit-Log-Reason"] = dataPackage.
reason;
125 Stickers::httpsClient->submitWorkloadAndGetResult<
void>(workload);
129 DiscordCoreInternal::HttpsClient* Stickers::httpsClient{};
The main namespace for this library.
A CoRoutine - representing a potentially asynchronous operation/function.
For getting a Sticker object for the given sticker ID.
Snowflake stickerId
The chosen Sticker's Snowflake.
For collecting a list of Stickers from a chosen Guild.
Snowflake guildId
The chosen Guild from which you would like to collect the Stickers from.
For creating a single Sticker.
Snowflake guildId
The Guild within which to create the Sticker.
std::string reason
The reason for creating the Sticker.
For modifying a single Sticker.
Snowflake stickerId
The Sticker you wish to modify.
Snowflake guildId
The Guild within which to modify the Sticker.
std::string reason
The reason for modifying the Sticker.
For deleting a single Sticker.
Snowflake guildId
The Guild within which to delete the Sticker.
std::string reason
The reason for deleting the Sticker.
Snowflake stickerId
The Sticker you wish to delete.
static CoRoutine< Sticker > modifyGuildStickerAsync(ModifyGuildStickerData dataPackage)
Modifies a Sticker within a chosen Guild.
static CoRoutine< Sticker > getStickerAsync(GetStickerData dataPackage)
Gets a single Sticker item.
static CoRoutine< std::vector< StickerPackData > > getNitroStickerPacksAsync()
Gets a list of nitro-available Sticker packs.
static CoRoutine< std::vector< Sticker > > getGuildStickersAsync(GetGuildStickersData dataPackage)
Gets a list of Stickers from a Guild.
static CoRoutine< Sticker > createGuildStickerAsync(CreateGuildStickerData dataPackage)
Creates a new Sticker within a chosen Guild.
static CoRoutine< void > deleteGuildStickerAsync(DeleteGuildStickerData dataPackage)
Deletes a Sticker within a chosen Guild.