setTriggerMetadata method

Future<void> setTriggerMetadata(
  1. ModerationTriggerMetadata triggerMetadata
)

Update the trigger metadata of this

Example :

final metadata = ModerationTriggerMetadata(
  keywordFilter: ['foo'],
  presets: [ModerationPresetType.profanity]
);

await rule.setTriggerMetadata(metadata);

Implementation

Future<void> setTriggerMetadata(ModerationTriggerMetadata triggerMetadata) async {
  Response response = await ioc.use<HttpService>().patch(url: "/guilds/$guildId/auto-moderation/rules/$id", payload: { 'trigger_metadata': triggerMetadata.toJson() });

  if (response.statusCode == 200) {
    this.triggerMetadata = triggerMetadata;
  }
}