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

#action -> Discorb::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_id -> Discorb::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

#channel -> Object (readonly)



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

def channel
  @client.channels[@channel_id]
end

#content -> String (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

#guild -> Object (readonly)



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

def guild
  @client.guilds[@guild_id]
end

#matched_content -> String? (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_keyword -> String? (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

#member -> Object (readonly) Also known as: user



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

def member
  guild.members[@user_id]
end

#message_id -> Discorb::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_id -> Discorb::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_type -> Symbol (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