Class: Discordrb::AuditLogs::Change
- Inherits:
-
Object
- Object
- Discordrb::AuditLogs::Change
- Defined in:
- lib/discordrb/data/audit_logs.rb
Overview
A change in a audit log entry.
Instance Attribute Summary collapse
-
#key ⇒ String
readonly
The key that was changed.
-
#new ⇒ String, ...
(also: #new_value)
readonly
The value that was changed to.
-
#old ⇒ String, ...
(also: #old_value)
readonly
The value that was changed from.
Instance Method Summary collapse
-
#new_afk_channel ⇒ Channel?
The channel that is used in the server as an AFK channel prior to this change.
-
#new_owner ⇒ Member, ...
The member that is now the owner of the server prior to this change.
-
#new_widget_channel ⇒ Channel?
The channel that is used in the server widget prior to this change.
-
#old_afk_channel ⇒ Channel?
The channel that was previously used in the server as an AFK channel.
-
#old_owner ⇒ Member, ...
The member that used to be the owner of the server.
-
#old_widget_channel ⇒ Channel?
The channel that was previously used in the server widget.
Instance Attribute Details
#key ⇒ String (readonly)
You should check with the Discord API Documentation on what key gives out what value.
Returns the key that was changed.
200 201 202 |
# File 'lib/discordrb/data/audit_logs.rb', line 200 def key @key end |
#new ⇒ String, ... (readonly) Also known as: new_value
Returns the value that was changed to.
207 208 209 |
# File 'lib/discordrb/data/audit_logs.rb', line 207 def new @new end |
#old ⇒ String, ... (readonly) Also known as: old_value
Returns the value that was changed from.
203 204 205 |
# File 'lib/discordrb/data/audit_logs.rb', line 203 def old @old end |
Instance Method Details
#new_afk_channel ⇒ Channel?
Returns the channel that is used in the server as an AFK channel prior to this change. Only present if the key for this change is afk_channel_id
.
242 243 244 |
# File 'lib/discordrb/data/audit_logs.rb', line 242 def new_afk_channel @bot.channel(@new, @server) if @new && @key == 'afk_channel_id' end |
#new_owner ⇒ Member, ...
Returns the member that is now the owner of the server prior to this change. Only present if the key for this change is owner_id
.
252 253 254 |
# File 'lib/discordrb/data/audit_logs.rb', line 252 def new_owner @server.member(@new) || @bot.user(@new) || @logs.user(@new) if @new && @key == 'owner_id' end |
#new_widget_channel ⇒ Channel?
Returns the channel that is used in the server widget prior to this change. Only present if the key for this change is widget_channel_id
.
232 233 234 |
# File 'lib/discordrb/data/audit_logs.rb', line 232 def @bot.channel(@new, @server) if @new && @key == 'widget_channel_id' end |
#old_afk_channel ⇒ Channel?
Returns the channel that was previously used in the server as an AFK channel. Only present if the key for this change is afk_channel_id
.
237 238 239 |
# File 'lib/discordrb/data/audit_logs.rb', line 237 def old_afk_channel @bot.channel(@old, @server) if @old && @key == 'afk_channel_id' end |
#old_owner ⇒ Member, ...
Returns the member that used to be the owner of the server. Only present if the for key for this change is owner_id
.
247 248 249 |
# File 'lib/discordrb/data/audit_logs.rb', line 247 def old_owner @server.member(@old) || @bot.user(@old) || @logs.user(@old) if @old && @key == 'owner_id' end |
#old_widget_channel ⇒ Channel?
Returns the channel that was previously used in the server widget. Only present if the key for this change is widget_channel_id
.
227 228 229 |
# File 'lib/discordrb/data/audit_logs.rb', line 227 def @bot.channel(@old, @server) if @old && @key == 'widget_channel_id' end |