36 template<>
struct core<discord_core_api::create_auto_moderation_rule_data> {
37 using value_type = discord_core_api::create_auto_moderation_rule_data;
38 static constexpr auto parseValue = createValue(
"exemptChannels", &value_type::exemptChannels,
"exemptRoles", &value_type::exemptRoles,
"triggerMetadata",
39 &value_type::triggerMetadata,
"actions", &value_type::actions,
"triggerType", &value_type::triggerType,
"eventType", &value_type::eventType,
"guildId",
40 &value_type::guildId,
"name", &value_type::name,
"enabled", &value_type::enabled);
43 template<>
struct core<discord_core_api::modify_auto_moderation_rule_data> {
44 using value_type = discord_core_api::modify_auto_moderation_rule_data;
45 static constexpr auto parseValue = createValue(
"exemptChannels", &value_type::exemptChannels,
"exemptRoles", &value_type::exemptRoles,
"triggerMetadata",
46 &value_type::triggerMetadata,
"actions", &value_type::actions,
"autoModerationRuleId", &value_type::autoModerationRuleId,
"eventType", &value_type::eventType,
47 "guildId", &value_type::guildId,
"name", &value_type::name,
"enabled", &value_type::enabled);
55 auto_moderation_rules::httpsClient = https_client_new;
59 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Auto_Moderation_Rules };
61 workload.workloadClass = discord_core_internal::https_workload_class::Get;
62 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules";
63 workload.callStack =
"auto_moderation_rules::listAutoModerationRulesForGuildAsync()";
64 jsonifier::vector<auto_moderation_rule_data> returnVector{};
65 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnVector);
66 co_return std::move(returnVector);
70 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Get_Auto_Moderation_Rule };
72 workload.workloadClass = discord_core_internal::https_workload_class::Get;
73 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules/" + dataPackage.
autoModerationRuleId.operator jsonifier::string();
74 workload.callStack =
"auto_moderation_rules::getAutoModerationRuleAsync()";
75 auto_moderation_rule_data returnData{};
76 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
81 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Post_Auto_Moderation_Rule };
83 workload.workloadClass = discord_core_internal::https_workload_class::Post;
84 workload.relativePath =
"/guilds/" + dataPackage.
guildId +
"/auto-moderation/rules";
85 parser.serializeJson(dataPackage, workload.content);
86 workload.callStack =
"auto_moderation_rules::createAutoModerationRuleAsync()";
87 auto_moderation_rule_data returnData{};
88 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
93 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Patch_Auto_Moderation_Rule };
95 workload.workloadClass = discord_core_internal::https_workload_class::Patch;
97 parser.serializeJson(dataPackage, workload.content);
98 workload.callStack =
"auto_moderation_rules::modifyAutoModerationRuleAsync()";
99 auto_moderation_rule_data returnData{};
100 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload), returnData);
101 co_return returnData;
105 discord_core_internal::https_workload_data workload{ discord_core_internal::https_workload_type::Delete_Auto_Moderation_Rule };
107 workload.workloadClass = discord_core_internal::https_workload_class::Delete;
109 workload.callStack =
"auto_moderation_rules::deleteAutoModerationRuleAsync()";
110 auto_moderation_rules::httpsClient->submitWorkloadAndGetResult(std::move(workload));
co_routine< auto_moderation_rule_data > modifyAutoModerationRuleAsync(modify_auto_moderation_rule_data dataPackage)
Modify a particular auto-moderation-rule.
co_routine< jsonifier::vector< auto_moderation_rule_data > > listAutoModerationRulesForGuildAsync(list_auto_moderation_rules_for_guild_data dataPackage)
Get all of the guild's auto-moderation-rules.
co_routine< auto_moderation_rule_data > getAutoModerationRuleAsync(get_auto_moderation_rule_data dataPackage)
Get a particular auto-moderation-rule.
co_routine< void > deleteAutoModerationRuleAsync(delete_auto_moderation_rule_data dataPackage)
Delete a particular auto-moderation-rule.
co_routine< auto_moderation_rule_data > createAutoModerationRuleAsync(create_auto_moderation_rule_data dataPackage)
Create a particular auto-moderation-rule.
A co_routine - representing a potentially asynchronous operation/function.
For sending Https requests.
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 an auto-moderation-rule.
snowflake guildId
The guild within which to create the auto_moderation_rule_data.
For deleting an auto-moderation-rule.
snowflake guildId
Guild within which to delete the auto-moderation-rule.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to delete.
For collecting an auto-moderation-rule for a particular auto_moderation_rule_data.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to collect.
snowflake guildId
The id of the guild from which you would like to collect the auto-moderation-rule from.
For listing all of the auto-moderation-rules for a particular guild .
snowflake guildId
The id of the guild for which you would like to list the auto-moderation rules.
For modifying an auto-moderation-rule.
snowflake guildId
The auto_moderation_rule_data within which to modify the auto-moderation-rule.
snowflake autoModerationRuleId
The id of the auto-moderation-rule you would like to modify.