Class: LibDiscord::AutoModeration

Inherits:
Resource
  • Object
show all
Defined in:
lib/lib_discord/auto_moderation.rb

Overview

Auto Moderation

Do not instantiate an AutoModeration directly. Instead request one from an instance of Client.

client = LibDiscord::Client.new("Bot auth.token")
a = client["auto_moderation"]

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from LibDiscord::Resource

Instance Method Details

#create_auto_moderation_rule(guild_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



64
65
66
# File 'lib/lib_discord/auto_moderation.rb', line 64

def create_auto_moderation_rule(guild_id:, json:)
  send_request(:post, "/guilds/#{guild_id}/auto-moderation/rules", json:)
end

#delete_auto_moderation_rule(guild_id:, auto_moderation_rule_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



102
103
104
# File 'lib/lib_discord/auto_moderation.rb', line 102

def delete_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
  send_request(:delete, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
end

#get_auto_moderation_rule(guild_id:, auto_moderation_rule_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



47
48
49
# File 'lib/lib_discord/auto_moderation.rb', line 47

def get_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
  send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
end

#list_auto_moderation_rules_for_guild(guild_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



29
30
31
# File 'lib/lib_discord/auto_moderation.rb', line 29

def list_auto_moderation_rules_for_guild(guild_id:)
  send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules")
end

#modify_auto_moderation_rule(guild_id:, auto_moderation_rule_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



84
85
86
# File 'lib/lib_discord/auto_moderation.rb', line 84

def modify_auto_moderation_rule(guild_id:, auto_moderation_rule_id:, json:)
  send_request(:patch, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}", json:)
end