DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
WebHookEntities.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/// WebHookEntities.cpp - the source file for web_hook_data relate stuff.
27/// Dec 1, 2021
28/// https://discordcoreapi.com
29/// \file WebHookEntities.cpp
30
35
36namespace jsonifier {
37
38 template<> struct core<discord_core_api::execute_web_hook_data> {
40 static constexpr auto parseValue = createObject("threadId", &value_type::threadId, "wait", &value_type::wait, "attachments", &value_type::attachments, "components",
41 &value_type::components, "allowedMentions", &value_type::allowedMentions, "embeds", &value_type::embeds, "files", &value_type::files, "webhookToken",
42 &value_type::webhookToken, "avatarUrl", &value_type::avatarUrl, "username", &value_type::userName, "customId", &value_type::customId, "webHookId",
43 &value_type::webHookId, "content", &value_type::content, "title", &value_type::title, "flags", &value_type::flags, "tts", &value_type::tts);
44 };
45
46 template<> struct core<discord_core_api::create_web_hook_data> {
48 static constexpr auto parseValue = createObject("channelId", &value_type::channelId, "avatar", &value_type::avatar, "name", &value_type::name);
49 };
50
51 template<> struct core<discord_core_api::modify_web_hook_data> {
53 static constexpr auto parseValue =
54 createObject("channelId", &value_type::channelId, "webHookId", &value_type::webHookId, "avatar", &value_type::avatar, "name", &value_type::name);
55 };
56
57 template<> struct core<discord_core_api::modify_web_hook_with_token_data> {
59 static constexpr auto parseValue = createObject("webhookToken", &value_type::webhookToken, "channelId", &value_type::channelId, "webHookId", &value_type::webHookId,
60 "avatar", &value_type::avatar, "name", &value_type::name);
61 };
62
63 template<> struct core<discord_core_api::edit_web_hook_data> {
64 using value_type = discord_core_api::edit_web_hook_data;
65 static constexpr auto parseValue =
66 createObject("threadId", &value_type::threadId, "wait", &value_type::wait, "attachments", &value_type::attachments, "components", &value_type::components,
67 "allowedMentions", &value_type::allowedMentions, "embeds", &value_type::embeds, "files", &value_type::files, "webhookToken", &value_type::webhookToken, "avatarUrl",
68 &value_type::avatarUrl, "username", &value_type::userName, "customId", &value_type::customId, "webHookId", &value_type::webHookId, "content", &value_type::content,
69 "title", &value_type::title, "flags", &value_type::flags, "tts", &value_type::tts, "message_id", &value_type::messageId, "thread_id", &value_type::threadId);
70 };
71}
72
73
74namespace discord_core_api {
75
76 execute_web_hook_data::execute_web_hook_data(const web_hook_data& dataNew) {
77 webhookToken = dataNew.token;
78 webHookId = dataNew.id;
79 }
80
81 execute_web_hook_data& execute_web_hook_data::addButton(bool disabled, jsonifier::string_view customIdNew, jsonifier::string_view buttonLabel, button_style buttonStyle,
82 jsonifier::string_view emojiName, snowflake emojiId, jsonifier::string_view url) {
83 if (components.size() == 0) {
84 action_row_data actionRowData;
85 components.emplace_back(actionRowData);
86 }
87 if (components.size() < 5) {
88 if (components[components.size() - 1].components.size() < 5) {
89 component_data component;
90 component.type = component_type::Button;
91 component.emoji.name = emojiName;
92 component.label = buttonLabel;
93 component.style = static_cast<uint64_t>(buttonStyle);
94 component.customId = customIdNew;
95 component.disabled = disabled;
96 component.emoji.id = emojiId;
97 component.url = url;
98 components[components.size() - 1].components.emplace_back(component);
99 } else if (components[components.size() - 1].components.size() == 5) {
100 action_row_data actionRowData;
101 components.emplace_back(actionRowData);
102 }
103 }
104 return *this;
105 }
106
107 execute_web_hook_data& execute_web_hook_data::addSelectMenu(bool disabled, jsonifier::string_view customIdNew, const jsonifier::vector<select_option_data>& options,
108 jsonifier::string_view placeholder, int32_t maxValues, int32_t minValues, select_menu_type type, const jsonifier::vector<channel_type>& channelTypes) {
109 if (components.size() == 0) {
110 action_row_data actionRowData;
111 components.emplace_back(actionRowData);
112 }
113 if (components.size() < 5) {
114 if (components[components.size() - 1].components.size() < 5) {
115 component_data componentData;
116 componentData.type = static_cast<component_type>(type);
117 componentData.channelTypes = channelTypes;
118 componentData.placeholder = placeholder;
119 componentData.customId = customIdNew;
120 componentData.maxValues = static_cast<uint64_t>(maxValues);
121 componentData.minValues = static_cast<uint64_t>(minValues);
122 componentData.disabled = disabled;
123 componentData.options = options;
124 components[components.size() - 1].components.emplace_back(componentData);
125 } else if (components[components.size() - 1].components.size() == 5) {
126 action_row_data actionRowData;
127 components.emplace_back(actionRowData);
128 }
129 }
130 return *this;
131 }
132
133 execute_web_hook_data& execute_web_hook_data::addModal(jsonifier::string_view topTitleNew, jsonifier::string_view topCustomIdNew, jsonifier::string_view titleNew,
134 jsonifier::string_view customIdNew, bool required, int32_t minLength, int32_t maxLength, text_input_style inputStyle, jsonifier::string_view label,
135 jsonifier::string_view placeholder) {
136 title = topTitleNew;
137 customId = topCustomIdNew;
138 if (components.size() == 0) {
139 action_row_data actionRowData;
140 components.emplace_back(actionRowData);
141 }
142 if (components.size() < 5) {
143 if (components[components.size() - 1].components.size() < 5) {
144 component_data component{};
145 component.type = component_type::Text_Input;
146 component.customId = customIdNew;
147 component.style = static_cast<uint64_t>(inputStyle);
148 component.title = titleNew;
149 component.maxLength = static_cast<uint64_t>(maxLength);
150 component.minLength = static_cast<uint64_t>(minLength);
151 component.label = label;
152 component.required = required;
153 component.placeholder = placeholder;
154 components[components.size() - 1].components.emplace_back(component);
155 } else if (components[components.size() - 1].components.size() == 5) {
156 action_row_data actionRowData;
157 components.emplace_back(actionRowData);
158 }
159 }
160 return *this;
161 }
162
164 files.emplace_back(theFile);
165 return *this;
166
167 }
169 allowedMentions = dataPackage;
170 return *this;
171 }
172
174 components.emplace_back(dataPackage);
175 return *this;
176 }
177
179 embeds.emplace_back(dataPackage);
180 return *this;
181 }
182
183 execute_web_hook_data& execute_web_hook_data::addContent(jsonifier::string_view dataPackage) {
184 content = dataPackage;
185 return *this;
186 }
187
189 tts = enabledTTs;
190 return *this;
191 }
192
193 edit_web_hook_data::edit_web_hook_data(const web_hook_data& dataNew) {
194 webhookToken = dataNew.token;
195 webHookId = dataNew.id;
196 }
197
198 void execute_web_hook_data::generateExcludedKeys() {
199 if (attachments.size() == 0) {
200 excludedKeys.emplace("attachments");
201 }
202 if (allowedMentions.parse.size() == 0 && allowedMentions.roles.size() == 0 && allowedMentions.users.size() == 0) {
203 excludedKeys.emplace("allowed_mentions");
204 }
205 if (components.size() == 0) {
206 excludedKeys.emplace("components");
207 }
208 for (auto& value: components) {
209 value.generateExcludedKeys();
210 }
211 if (embeds.size() == 0) {
212 excludedKeys.emplace("embeds");
213 }
214 for (auto& value: embeds) {
215 value.generateExcludedKeys();
216 }
217 if (files.size() == 0) {
218 excludedKeys.emplace("files");
219 }
220 if (avatarUrl == "") {
221 excludedKeys.emplace("avatar_url");
222 }
223 if (customId == "") {
224 excludedKeys.emplace("custom_id");
225 }
226 if (userName == "") {
227 excludedKeys.emplace("username");
228 }
229 if (title == "") {
230 excludedKeys.emplace("title");
231 }
232 if (content == "") {
233 excludedKeys.emplace("content");
234 }
235 return;
236 }
237
238
239 void discord_core_api::web_hooks::initialize(discord_core_internal::https_client* client) {
240 discord_core_api::web_hooks::httpsClient = client;
241 }
242
244 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Webhook };
245 co_await newThreadAwaitable<web_hook_data>();
246 workload.workloadClass = discord_core_internal::https_workload_class::Post;
247 workload.relativePath = "/channels/" + dataPackage.channelId + "/webhooks";
248 workload.callStack = "discord_core_api::web_hooks::createWebHookAsync()";
249 parser.serializeJson<true>(dataPackage, workload.content);
250 web_hook_data returnData{};
251 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
252 co_return returnData;
253 }
254
256 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Channel_Webhooks };
257 co_await newThreadAwaitable<jsonifier::vector<web_hook_data>>();
258 workload.workloadClass = discord_core_internal::https_workload_class::Get;
259 workload.relativePath = "/channels/" + dataPackage.channelId + "/webhooks";
260 workload.callStack = "discord_core_api::web_hooks::getChannelWebHooksAsync()";
261 jsonifier::vector<web_hook_data> returnData{};
262 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
263 co_return returnData;
264 }
265
267 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Guild_Webhooks };
268 co_await newThreadAwaitable<jsonifier::vector<web_hook_data>>();
269 workload.workloadClass = discord_core_internal::https_workload_class::Get;
270 workload.relativePath = "/guilds/" + dataPackage.guildId + "/webhooks";
271 workload.callStack = "discord_core_api::web_hooks::getGuildWebHooksAsync()";
272 jsonifier::vector<web_hook_data> returnData{};
273 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
274 co_return returnData;
275 }
276
278 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Webhook };
279 co_await newThreadAwaitable<web_hook_data>();
280 workload.workloadClass = discord_core_internal::https_workload_class::Get;
281 workload.relativePath = "/webhooks/" + dataPackage.webHookId;
282 workload.callStack = "discord_core_api::web_hooks::getWebHookAsync()";
283 web_hook_data returnData{};
284 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
285 co_return returnData;
286 }
287
289 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Webhook_With_Token };
290 co_await newThreadAwaitable<web_hook_data>();
291 workload.workloadClass = discord_core_internal::https_workload_class::Get;
292 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken;
293 workload.callStack = "discord_core_api::web_hooks::getWebHookWithTokenAsync()";
294 web_hook_data returnData{};
295 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
296 co_return returnData;
297 }
298
300 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Webhook };
301 co_await newThreadAwaitable<web_hook_data>();
302 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
303 workload.relativePath = "/webhooks/" + dataPackage.webHookId;
304 parser.serializeJson<true>(dataPackage, workload.content);
305 workload.callStack = "discord_core_api::web_hooks::modifyWebHookAsync()";
306 web_hook_data returnData{};
307 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
308 co_return returnData;
309 }
310
312 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Webhook_With_Token };
313 co_await newThreadAwaitable<web_hook_data>();
314 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
315 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken;
316 parser.serializeJson<true>(dataPackage, workload.content);
317 workload.callStack = "discord_core_api::web_hooks::modifyWebHookWithTokenAsync()";
318 web_hook_data returnData{};
319 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
320 co_return returnData;
321 }
322
324 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Webhook };
325 co_await newThreadAwaitable<void>();
326 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
327 workload.relativePath = "/webhooks/" + dataPackage.webHookId;
328 workload.callStack = "discord_core_api::web_hooks::deleteWebHookAsync()";
329 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload));
330 co_return;
331 }
332
334 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Webhook_With_Token };
335 co_await newThreadAwaitable<void>();
336 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
337 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken;
338 workload.callStack = "discord_core_api::web_hooks::deleteWebHookWithTokenAsync()";
339 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload));
340 co_return;
341 }
342
344 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Execute_Webhook };
345 co_await newThreadAwaitable<message_data>();
346 workload.workloadClass = discord_core_internal::https_workload_class::Post;
347 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken;
348 workload.callStack = "discord_core_api::web_hooks::executeWebHookAsync()";
349 if (dataPackage.wait) {
350 workload.relativePath += "?wait=true";
351 if (dataPackage.threadId != 0) {
352 workload.relativePath += "&thread_id=" + dataPackage.threadId;
353 }
354 }
355 if (dataPackage.threadId != 0) {
356 workload.relativePath += "?thread_id=" + dataPackage.threadId;
357 }
358 if (dataPackage.files.size() > 0) {
359 workload.payloadType = discord_core_internal::payload_type::Multipart_Form;
360 parser.serializeJson<true>(dataPackage, workload.content);
361 workload.content = constructMultiPartData(workload.content, dataPackage.files);
362 } else {
363 parser.serializeJson<true>(dataPackage, workload.content);
364 }
365 message_data returnData{};
366 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
367 co_return returnData;
368 }
369
371 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Webhook_Message };
372 co_await newThreadAwaitable<message_data>();
373 workload.workloadClass = discord_core_internal::https_workload_class::Get;
374 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken + "/messages/" + dataPackage.messageId;
375 if (dataPackage.threadId != 0) {
376 workload.relativePath += "?thread_id=" + dataPackage.threadId;
377 }
378 workload.callStack = "discord_core_api::web_hooks::getWebHookMessageAsync()";
379 message_data returnData{};
380 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
381 co_return returnData;
382 }
383
385 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Webhook_Message };
386 co_await newThreadAwaitable<message_data>();
387 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
388 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken + "/messages/" + dataPackage.messageId;
389 if (dataPackage.threadId != 0) {
390 workload.relativePath += "?thread_id=" + dataPackage.threadId;
391 }
392 if (dataPackage.files.size() > 0) {
393 workload.payloadType = discord_core_internal::payload_type::Multipart_Form;
394 parser.serializeJson<true>(dataPackage, workload.content);
395 workload.content = constructMultiPartData(workload.content, dataPackage.files);
396 } else {
397 parser.serializeJson<true>(dataPackage, workload.content);
398 }
399 workload.callStack = "discord_core_api::web_hooks::editWebHookMessageAsync()";
400 message_data returnData{};
401 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
402 co_return returnData;
403 }
404
406 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Webhook_Message };
407 co_await newThreadAwaitable<void>();
408 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
409 workload.relativePath = "/webhooks/" + dataPackage.webHookId + "/" + dataPackage.webhookToken + "/messages/" + dataPackage.messageId;
410 if (dataPackage.threadId != 0) {
411 workload.relativePath += "?thread_id=" + dataPackage.threadId;
412 }
413 workload.callStack = "discord_core_api::web_hooks::deleteWebHookMessageAsync()";
414 discord_core_api::web_hooks::httpsClient->submitWorkloadAndGetResult(std::move(workload));
415 co_return;
416 }
417
418 discord_core_internal::https_client* discord_core_api::web_hooks::httpsClient{};
419}
Action row data of message components.
Allowable mentions for a message.
jsonifier::vector< jsonifier::string > roles
Array of role_ids to mention (max size of 100)
jsonifier::vector< jsonifier::string > users
Array of user_ids to mention (max size of 100)
jsonifier::vector< jsonifier::string > parse
A vector of allowed mention types to parse from the content.
A co_routine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:83
For editing a web_hook message_data.
snowflake threadId
Send a message to the specified thread within a webhook's channel_data. the thread will automatically...
snowflake messageId
The message snowflake to collect.
allowed_mentions_data allowedMentions
Allowed mention object.
jsonifier::vector< embed_data > embeds
Array of up to 10 embed objects.
jsonifier::string content
The message contents (up to 2000 characters) one of content, file, embeds.
snowflake webHookId
The web_hook_data you would like to execute.
jsonifier::string userName
Override the default username of the webhook.
execute_web_hook_data & addContent(jsonifier::string_view dataPackage)
For setting the content in a response.
jsonifier::string webhookToken
The web_hook_data token you would like to execute.
snowflake threadId
Send a message to the specified thread within a webhook's channel_data. the thread will automatically...
execute_web_hook_data & setTTSStatus(bool enabledTTs)
For setting the tts status of a response.
execute_web_hook_data & addAllowedMentions(const allowed_mentions_data dataPackage)
For setting the allowable mentions in a response.
execute_web_hook_data & addFile(const file &theFile)
Adds a file to the current collection of files for this message response.
jsonifier::string title
Title for the modal.
jsonifier::vector< file > files
File contents the contents of the file being sent.
execute_web_hook_data & addMessageEmbed(const embed_data dataPackage)
For setting the embeds in a response.
execute_web_hook_data & addSelectMenu(bool disabled, jsonifier::string_view customIdNew, const jsonifier::vector< select_option_data > &options, jsonifier::string_view placeholder, int32_t maxValues, int32_t minValues, select_menu_type type, const jsonifier::vector< channel_type > &channelTypes=jsonifier::vector< channel_type >{})
Adds a select-menu to the response message_data.
jsonifier::vector< attachment_data > attachments
Array of partial attachment objects attachment objects with filename and description.
execute_web_hook_data & addComponentRow(const action_row_data dataPackage)
For setting the components in a response.
jsonifier::string customId
custom id for the modal.
bool wait
Waits for server confirmation of message send before response, and returns the created message body.
jsonifier::string avatarUrl
Override the default avatar of the webhook.
execute_web_hook_data & addButton(bool disabled, jsonifier::string_view customIdNew, jsonifier::string_view buttonLabel, button_style buttonStyle, jsonifier::string_view emojiName="", snowflake emojiId=snowflake{}, jsonifier::string_view url="")
Adds a button to the response message_data.
jsonifier::vector< action_row_data > components
Array of message component the components to include with the message.
bool tts
True if this is a tts message.
execute_web_hook_data & addModal(jsonifier::string_view topTitleNew, jsonifier::string_view topCustomIdNew, jsonifier::string_view titleNew, jsonifier::string_view customIdNew, bool required, int32_t minLength, int32_t maxLength, text_input_style inputStyle, jsonifier::string_view label="", jsonifier::string_view placeholder="")
Adds a modal to the response message_data.
Data structure representing a single message_data.
A class representing a snowflake identifier with various operations.
Definition: Base.hpp:680
uint64_t id
The snowflake id.
Definition: Base.hpp:811
jsonifier::string token
Token of the web_hook_data.
static co_routine< jsonifier::vector< web_hook_data > > getGuildWebHooksAsync(const get_guild_web_hooks_data dataPackage)
Collects a list of web_hooks from a chosen guild.
static co_routine< web_hook_data > modifyWebHookWithTokenAsync(const modify_web_hook_with_token_data dataPackage)
Modifies a single web_hook_data, using its token.
static co_routine< web_hook_data > getWebHookWithTokenAsync(const get_web_hook_with_token_data dataPackage)
Collects a single web_hook_data, using the token.
static co_routine< void > deleteWebHookMessageAsync(const delete_web_hook_message_data dataPackage)
Deletes a web_hook message_data.
static co_routine< jsonifier::vector< web_hook_data > > getChannelWebHooksAsync(const get_channel_web_hooks_data dataPackage)
Collects a list of web_hooks from a chosen channel_data.
static co_routine< void > deleteWebHookWithTokenAsync(const delete_web_hook_with_token_data dataPackage)
Deletes a single web_hook_data, using its token.
static co_routine< web_hook_data > createWebHookAsync(const create_web_hook_data dataPackage)
Creates a new web_hook_data.
static co_routine< message_data > getWebHookMessageAsync(const get_web_hook_message_data dataPackage)
Collects a web_hook message_data.
static co_routine< void > deleteWebHookAsync(const delete_web_hook_data dataPackage)
Deletes a single web_hook_data.
static co_routine< message_data > executeWebHookAsync(const execute_web_hook_data dataPackage)
Executes a single web_hook_data.
static co_routine< message_data > editWebHookMessageAsync(const edit_web_hook_data dataPackage)
Edits a web_hook message_data.
static co_routine< web_hook_data > modifyWebHookAsync(const modify_web_hook_data dataPackage)
Modifies a single web_hook_data.
static co_routine< web_hook_data > getWebHookAsync(const get_web_hook_data dataPackage)
Collects a single web_hook_data.
button_style
Button styles.
text_input_style
Text input style for modals.
component_type
Component types.
@ Text_Input
Text input object.
The main namespace for the forward-facing interfaces.
For creating a new web_hook_data.
snowflake channelId
The channel_data within which to create the web_hook_data.
snowflake webHookId
The desired web_hook_data to delete.
For deleting a web_hook message_data.
snowflake threadId
Send a message to the specified thread within a webhook's channel_data. the thread will automatically...
snowflake webHookId
The web_hook_data you would like to collect.
snowflake messageId
The message snowflake to collect.
jsonifier::string webhookToken
The web_hook_data token you would like to collect.
For deleting a web_hook, using its token.
snowflake webHookId
The desired web_hook_data to delete.
jsonifier::string webhookToken
Token of the desired web_hook_data.
Data representing a file to be sent via multipart-form data.
For collecting a list of web_hooks from a chosen channel_data.
snowflake channelId
The channel_data from which to collect the web_hooks.
For collecting a list of web_hooks from a chosen guild.
snowflake guildId
The guild from which to collect the web_hooks.
Collects a single web_hook_data.
snowflake webHookId
snowflake of the desired web_hook_data to collect.
For getting a web_hook message_data.
jsonifier::string webhookToken
The web_hook_data token you would like to collect.
snowflake webHookId
The web_hook_data you would like to collect.
snowflake messageId
The message snowflake to collect.
snowflake threadId
The thread that the message is in.
Collects a single web_hook_data, using the token and snowflake.
snowflake webHookId
snowflake of the desired web_hook_data.
jsonifier::string webhookToken
Token of the desired web_hook_data.
snowflake webHookId
The web_hook_data to be modified.
jsonifier::string webhookToken
Token of the desired web_hook_data.
snowflake webHookId
The web_hook_data to be modified.