Class: Discordrb::AuditLogs::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data.rb

Overview

A change in a audit log entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyString (readonly)

Note:

You should check with the Discord API Documentation on what key gives out what value.

Returns the key that was changed.



4011
4012
4013
# File 'lib/discordrb/data.rb', line 4011

def key
  @key
end

#newString, ... (readonly) Also known as: new_value



4018
4019
4020
# File 'lib/discordrb/data.rb', line 4018

def new
  @new
end

#oldString, ... (readonly) Also known as: old_value



4014
4015
4016
# File 'lib/discordrb/data.rb', line 4014

def old
  @old
end

Instance Method Details

#new_afk_channelChannel?



4053
4054
4055
# File 'lib/discordrb/data.rb', line 4053

def new_afk_channel
  @bot.channel(@new, @server) if @new && @key == 'afk_channel_id'
end

#new_ownerMember, ...



4063
4064
4065
# File 'lib/discordrb/data.rb', line 4063

def new_owner
  @server.member(@new) || @bot.user(@new) || @logs.user(@new) if @new && @key == 'owner_id'
end

#new_widget_channelChannel?



4043
4044
4045
# File 'lib/discordrb/data.rb', line 4043

def new_widget_channel
  @bot.channel(@new, @server) if @new && @key == 'widget_channel_id'
end

#old_afk_channelChannel?



4048
4049
4050
# File 'lib/discordrb/data.rb', line 4048

def old_afk_channel
  @bot.channel(@old, @server) if @old && @key == 'afk_channel_id'
end

#old_ownerMember, ...



4058
4059
4060
# File 'lib/discordrb/data.rb', line 4058

def old_owner
  @server.member(@old) || @bot.user(@old) || @logs.user(@old) if @old && @key == 'owner_id'
end

#old_widget_channelChannel?



4038
4039
4040
# File 'lib/discordrb/data.rb', line 4038

def old_widget_channel
  @bot.channel(@old, @server) if @old && @key == 'widget_channel_id'
end