Class: Discordrb::AuditLogs::Entry
- Inherits:
-
Object
- Object
- Discordrb::AuditLogs::Entry
- Includes:
- IDObject
- Defined in:
- lib/discordrb/data/audit_logs.rb
Overview
An entry in a server's audit logs.
Instance Attribute Summary collapse
-
#action ⇒ Symbol
readonly
The action that was performed.
-
#action_type ⇒ Symbol
readonly
The type action that was performed.
-
#changes ⇒ Hash<String => Change>, ...
readonly
The changes from this log, listing the key as the key changed.
-
#count ⇒ Integer?
(also: #amount)
readonly
The amount of messages deleted.
-
#days ⇒ Integer?
readonly
The amount of days the members were inactive for.
-
#members_removed ⇒ Integer?
readonly
The amount of members removed.
-
#reason ⇒ String?
readonly
The reason for this action occurring.
-
#target_type ⇒ Symbol
readonly
The type of target being performed on.
Attributes included from IDObject
Instance Method Summary collapse
-
#channel ⇒ Channel?
The amount of messages deleted.
-
#inspect ⇒ Object
The inspect method is overwritten to give more useful output.
-
#target ⇒ Server, ...
The target being performed on.
-
#user ⇒ Member, User
(also: #author)
The user that authored this action.
Methods included from IDObject
#==, #creation_time, synthesise
Instance Attribute Details
#action ⇒ Symbol (readonly)
93 94 95 |
# File 'lib/discordrb/data/audit_logs.rb', line 93 def action @action end |
#action_type ⇒ Symbol (readonly)
96 97 98 |
# File 'lib/discordrb/data/audit_logs.rb', line 96 def action_type @action_type end |
#changes ⇒ Hash<String => Change>, ... (readonly)
115 116 117 |
# File 'lib/discordrb/data/audit_logs.rb', line 115 def changes @changes end |
#count ⇒ Integer? (readonly) Also known as: amount
102 103 104 |
# File 'lib/discordrb/data/audit_logs.rb', line 102 def count @count end |
#days ⇒ Integer? (readonly)
106 107 108 |
# File 'lib/discordrb/data/audit_logs.rb', line 106 def days @days end |
#members_removed ⇒ Integer? (readonly)
109 110 111 |
# File 'lib/discordrb/data/audit_logs.rb', line 109 def members_removed @members_removed end |
#reason ⇒ String? (readonly)
112 113 114 |
# File 'lib/discordrb/data/audit_logs.rb', line 112 def reason @reason end |
#target_type ⇒ Symbol (readonly)
99 100 101 |
# File 'lib/discordrb/data/audit_logs.rb', line 99 def target_type @target_type end |
Instance Method Details
#channel ⇒ Channel?
157 158 159 160 161 |
# File 'lib/discordrb/data/audit_logs.rb', line 157 def channel return nil unless @channel_id @channel ||= @bot.channel(@channel_id, @server, bot, self) end |
#inspect ⇒ Object
The inspect method is overwritten to give more useful output
179 180 181 |
# File 'lib/discordrb/data/audit_logs.rb', line 179 def inspect "<AuditLogs::Entry id=#{@id} key=#{@key} action=#{@action} reason=#{@reason} action_type=#{@action_type} target_type=#{@target_type} count=#{@count} days=#{@days} members_removed=#{@members_removed}>" end |
#target ⇒ Server, ...
146 147 148 |
# File 'lib/discordrb/data/audit_logs.rb', line 146 def target @target ||= process_target(@data['target_id'], @target_type) end |