Class: RubyCord::Guild::AuditLog::Entry

Inherits:
DiscordModel show all
Defined in:
lib/rubycord/guild/audit_log/entry.rb

Defined Under Namespace

Classes: Change, Changes

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Class Attribute Details

.convertsObject (readonly)

Returns the value of attribute converts.



211
212
213
# File 'lib/rubycord/guild/audit_log/entry.rb', line 211

def converts
  @converts
end

.eventsObject (readonly)

Returns the value of attribute events.



211
212
213
# File 'lib/rubycord/guild/audit_log/entry.rb', line 211

def events
  @events
end

Instance Attribute Details

#changesRubyCord::Guild::AuditLog::Entry::Changes (readonly)

Returns The changes in this entry.

Returns:



68
69
70
# File 'lib/rubycord/guild/audit_log/entry.rb', line 68

def changes
  @changes
end

#idRubyCord::Snowflake (readonly)

Returns The ID of the entry.

Returns:



10
11
12
# File 'lib/rubycord/guild/audit_log/entry.rb', line 10

def id
  @id
end

#optionsHash{Symbol => Object} (readonly)

Note:

You can use dot notation to access the data.

Returns The optional data for this entry.

Returns:

  • (Hash{Symbol => Object})

    The optional data for this entry.



74
75
76
# File 'lib/rubycord/guild/audit_log/entry.rb', line 74

def options
  @options
end

#targetRubyCord::Channel, ... (readonly)

Returns The target of the entry.



71
72
73
# File 'lib/rubycord/guild/audit_log/entry.rb', line 71

def target
  @target
end

#target_idRubyCord::Snowflake (readonly)

Returns The ID of the target of the action.

Returns:



14
15
16
# File 'lib/rubycord/guild/audit_log/entry.rb', line 14

def target_id
  @target_id
end

#typeSymbol (readonly)

These symbols will be used:

  • :guild_update
  • :channel_create
  • :channel_update
  • :channel_delete
  • :channel_overwrite_create
  • :channel_overwrite_update
  • :channel_overwrite_delete
  • :member_kick
  • :member_prune
  • :member_ban_add
  • :member_ban_remove
  • :member_update
  • :member_role_update
  • :member_move
  • :member_disconnect
  • :bot_add
  • :role_create
  • :role_update
  • :role_delete
  • :invite_create
  • :invite_update
  • :invite_delete
  • :webhook_create
  • :webhook_update
  • :webhook_delete
  • :emoji_create
  • :emoji_update
  • :emoji_delete
  • :message_delete
  • :message_bulk_delete
  • :message_pin
  • :message_unpin
  • :integration_create
  • :integration_update
  • :integration_delete
  • :stage_instance_create
  • :stage_instance_update
  • :stage_instance_delete
  • :sticker_create
  • :sticker_update
  • :sticker_delete
  • :guild_scheduled_event_create
  • :guild_scheduled_event_update
  • :guild_scheduled_event_delete
  • :thread_create
  • :thread_update
  • :thread_delete
  • :application_command_permission_update`

Returns:

  • (Symbol)

    The type of the entry.



66
67
68
# File 'lib/rubycord/guild/audit_log/entry.rb', line 66

def type
  @type
end

#userRubyCord::User (readonly)

Returns The user who performed the action.

Returns:



# File 'lib/rubycord/guild/audit_log/entry.rb', line 76


#user_idRubyCord::Snowflake (readonly)

Returns The ID of the user who performed the action.

Returns:



12
13
14
# File 'lib/rubycord/guild/audit_log/entry.rb', line 12

def user_id
  @user_id
end

Instance Method Details

#[](key) ⇒ RubyCord::Guild::AuditLog::Entry::Change?

Get a change with the given key.

Parameters:

  • key (Symbol)

    The key to get.

Returns:



202
203
204
# File 'lib/rubycord/guild/audit_log/entry.rb', line 202

def [](key)
  @changes[key]
end

#inspectObject



206
207
208
# File 'lib/rubycord/guild/audit_log/entry.rb', line 206

def inspect
  "#<#{self.class} #{@changes&.data&.length || "No"} changes>"
end