Class: DiscordRDA::AuditLog
- Inherits:
-
Object
- Object
- DiscordRDA::AuditLog
- Defined in:
- lib/discord_rda/entity/support.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#integrations ⇒ Object
readonly
Returns the value of attribute integrations.
-
#threads ⇒ Object
readonly
Returns the value of attribute threads.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
Instance Method Summary collapse
- #application_commands ⇒ Object
- #auto_moderation_rules ⇒ Object
-
#initialize(data = {}) ⇒ AuditLog
constructor
A new instance of AuditLog.
- #users_index ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ AuditLog
Returns a new instance of AuditLog.
559 560 561 562 563 564 565 566 567 |
# File 'lib/discord_rda/entity/support.rb', line 559 def initialize(data = {}) @entries = (data['audit_log_entries'] || []).map { |entry| AuditLogEntry.new(entry) } @users = (data['users'] || []).map { |user| User.new(user) } @webhooks = data['webhooks'] || [] @integrations = data['integrations'] || [] @threads = (data['threads'] || []).map { |thread| Channel.new(thread) } @application_commands = data['application_commands'] || [] @auto_moderation_rules = data['auto_moderation_rules'] || [] end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
557 558 559 |
# File 'lib/discord_rda/entity/support.rb', line 557 def entries @entries end |
#integrations ⇒ Object (readonly)
Returns the value of attribute integrations.
557 558 559 |
# File 'lib/discord_rda/entity/support.rb', line 557 def integrations @integrations end |
#threads ⇒ Object (readonly)
Returns the value of attribute threads.
557 558 559 |
# File 'lib/discord_rda/entity/support.rb', line 557 def threads @threads end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
557 558 559 |
# File 'lib/discord_rda/entity/support.rb', line 557 def users @users end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
557 558 559 |
# File 'lib/discord_rda/entity/support.rb', line 557 def webhooks @webhooks end |
Instance Method Details
#application_commands ⇒ Object
573 574 575 |
# File 'lib/discord_rda/entity/support.rb', line 573 def application_commands @application_commands end |
#auto_moderation_rules ⇒ Object
577 578 579 |
# File 'lib/discord_rda/entity/support.rb', line 577 def auto_moderation_rules @auto_moderation_rules end |
#users_index ⇒ Object
569 570 571 |
# File 'lib/discord_rda/entity/support.rb', line 569 def users_index @users_index ||= @users.each_with_object({}) { |user, index| index[user.id.to_s] = user } end |