Class: Discorb::Gateway::AutoModerationActionExecutionEvent

Inherits:
GatewayEvent
  • Object
show all
Defined in:
lib/discorb/gateway_events.rb

Overview

Represents a AUTO_MODERATION_ACTION_EXECUTION event.

Instance Attribute Summary collapse

Method Summary

Methods inherited from GatewayEvent

#inspect

Instance Attribute Details

#actionDiscorb::AutoModRule::Action (readonly)

Returns The action that was executed.

Returns:



621
622
623
# File 'lib/discorb/gateway_events.rb', line 621

def action
  @action
end

#alert_system_message_idDiscorb::Snowflake? (readonly)

Returns:

  • (Discorb::Snowflake)

    The id of the system message that was sent.

  • (nil)

    If the system message channel was not set.



607
608
609
# File 'lib/discorb/gateway_events.rb', line 607

def alert_system_message_id
  @alert_system_message_id
end

#channelObject (readonly)



657
658
659
# File 'lib/discorb/gateway_events.rb', line 657

def channel
  @client.channels[@channel_id]
end

#contentString (readonly)

Returns The content of the message that was sent.

Returns:

  • (String)

    The content of the message that was sent.



610
611
612
# File 'lib/discorb/gateway_events.rb', line 610

def content
  @content
end

#guildObject (readonly)



651
652
653
# File 'lib/discorb/gateway_events.rb', line 651

def guild
  @client.guilds[@guild_id]
end

#matched_contentString? (readonly)

Returns:

  • (String)

    The content that triggered the action.

  • (nil)

    If the action was not triggered by a keyword.



618
619
620
# File 'lib/discorb/gateway_events.rb', line 618

def matched_content
  @matched_content
end

#matched_keywordString? (readonly)

Returns:

  • (String)

    The keyword that triggered the action.

  • (nil)

    If the action was not triggered by a keyword.



614
615
616
# File 'lib/discorb/gateway_events.rb', line 614

def matched_keyword
  @matched_keyword
end

#memberObject (readonly) Also known as: user



663
664
665
# File 'lib/discorb/gateway_events.rb', line 663

def member
  guild.members[@user_id]
end

#message_idDiscorb::Snowflake? (readonly)

Returns:

  • (Discorb::Snowflake)

    The id of the message that triggered the action.

  • (nil)

    If the message was deleted.



603
604
605
# File 'lib/discorb/gateway_events.rb', line 603

def message_id
  @message_id
end

#rule_idDiscorb::Snowflake (readonly)

Returns The id of the rule.

Returns:



596
597
598
# File 'lib/discorb/gateway_events.rb', line 596

def rule_id
  @rule_id
end

#rule_trigger_typeSymbol (readonly)

Returns The type of action that was executed.

Returns:

  • (Symbol)

    The type of action that was executed.



599
600
601
# File 'lib/discorb/gateway_events.rb', line 599

def rule_trigger_type
  @rule_trigger_type
end