37 template<>
struct core<discord_core_api::create_guild_sticker_data> {
38 using value_type = discord_core_api::create_guild_sticker_data;
39 static constexpr auto parseValue = createValue(
"description", &value_type::description,
"guildId", &value_type::guildId,
"file",
40 &value_type::file,
"name", &value_type::name,
"tags", &value_type::tags);
43 template<>
struct core<discord_core_api::modify_guild_sticker_data> {
44 using value_type = discord_core_api::modify_guild_sticker_data;
45 static constexpr auto parseValue = createValue(
"description", &value_type::description,
"stickerId", &value_type::stickerId,
"guildId",
46 &value_type::guildId,
"name", &value_type::name,
"tags", &value_type::tags);
54 stickers::httpsClient = client;
58 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Sticker };
60 workload.workloadClass = discord_core_internal::https_workload_class::Get;
61 workload.relativePath =
"/stickers/" + dataPackage.
stickerId;
62 workload.callStack =
"stickers::getStickerAsync()";
63 sticker_data returnData{};
64 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
69 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Nitro_Sticker_Packs };
71 workload.workloadClass = discord_core_internal::https_workload_class::Get;
72 workload.relativePath =
"/sticker-packs";
73 workload.callStack =
"stickers::getNitroStickerPacksAsync()";
74 jsonifier::vector<sticker_pack_data> returnData{};
75 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
80 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Stickers };
82 workload.workloadClass = discord_core_internal::https_workload_class::Get;
83 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers";
84 workload.callStack =
"stickers::getGuildStickersAsync()";
85 jsonifier::vector<sticker_data> returnData{};
86 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
91 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Guild_Sticker };
93 workload.workloadClass = discord_core_internal::https_workload_class::Post;
94 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers";
95 parser.serializeJson(dataPackage, workload.content);
96 workload.callStack =
"stickers::createGuildStickerAsync()";
97 if (dataPackage.
reason !=
"") {
98 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
100 sticker_data returnData{};
101 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
102 co_return returnData;
106 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Guild_Sticker };
108 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
109 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers/" + dataPackage.
stickerId;
110 parser.serializeJson(dataPackage, workload.content);
111 workload.callStack =
"stickers::modifyGuildStickerAsync()";
112 if (dataPackage.
reason !=
"") {
113 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
115 sticker_data returnData{};
116 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
117 co_return returnData;
121 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Guild_Sticker };
123 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
124 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/stickers/" + dataPackage.
stickerId;
125 workload.callStack =
"stickers::deleteGuildStickerAsync()";
126 if (dataPackage.
reason !=
"") {
127 workload.headersToInsert[
"x-audit-log-reason"] = dataPackage.
reason;
129 stickers::httpsClient->submitWorkloadAndGetResult(std::move(workload));
A co_routine - representing a potentially asynchronous operation/function.
For sending Https requests.
static co_routine< jsonifier::vector< sticker_data > > getGuildStickersAsync(get_guild_stickers_data dataPackage)
Gets a list of stickers from a guild.
static co_routine< void > deleteGuildStickerAsync(delete_guild_sticker_data dataPackage)
Deletes a sticker_data within a chosen guild.
static co_routine< jsonifier::vector< sticker_pack_data > > getNitroStickerPacksAsync()
Gets a list of nitro-available sticker_data packs.
static co_routine< sticker_data > getStickerAsync(get_sticker_data dataPackage)
Gets a single sticker_data item.
static co_routine< sticker_data > createGuildStickerAsync(create_guild_sticker_data dataPackage)
Creates a new sticker_data within a chosen guild.
static co_routine< sticker_data > modifyGuildStickerAsync(modify_guild_sticker_data dataPackage)
Modifies a sticker_data within a chosen guild.
DCA_INLINE auto newThreadAwaitable()
An awaitable that can be used to launch the co_routine onto a new thread - as well as return the hand...
The main namespace for the forward-facing interfaces.
For creating a single sticker_data.
jsonifier::string reason
The reason for creating the sticker_data.
snowflake guildId
The guild within which to create the sticker_data.
For deleting a single sticker_data.
snowflake stickerId
The sticker_data you wish to delete.
snowflake guildId
The guild within which to delete the sticker_data.
jsonifier::string reason
The reason for deleting the sticker_data.
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 getting a sticker_data object for the given sticker id.
snowflake stickerId
The chosen sticker_data's snowflake.
For modifying a single sticker_data.
snowflake stickerId
The sticker_data you wish to modify.
jsonifier::string reason
The reason for modifying the sticker_data.
snowflake guildId
The guild within which to modify the sticker_data.