Skip to content

Commit

Permalink
fix: update audit log processing (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
swarley committed Aug 16, 2022
1 parent 7c7865d commit dc27fe1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/discordrb/data/audit_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def process_target(id, type)

# The inspect method is overwritten to give more useful output
def inspect
"<AuditLogs::Entry id=#{@id} action=#{@action} reason=#{@reason} action_type=#{@action_type} target_type=#{@target_type} count=#{@count} days=#{@days} members_removed=#{@members_removed}>"
"<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

# Process action changes
Expand Down Expand Up @@ -219,8 +219,8 @@ def initialize(data, server, bot, logs)
@old = Permissions.new(@old) if @old && @key == 'permissions'
@new = Permissions.new(@new) if @new && @key == 'permissions'

@old = @old.map { |o| Overwrite.new(o['id'], type: o['type'].to_sym, allow: o['allow'], deny: o['deny']) } if @old && @key == 'permission_overwrites'
@new = @new.map { |o| Overwrite.new(o['id'], type: o['type'].to_sym, allow: o['allow'], deny: o['deny']) } if @new && @key == 'permission_overwrites'
@old = @old.map { |o| Overwrite.new(o['id'], type: o['type'], allow: o['allow'], deny: o['deny']) } if @old && @key == 'permission_overwrites'
@new = @new.map { |o| Overwrite.new(o['id'], type: o['type'], allow: o['allow'], deny: o['deny']) } if @new && @key == 'permission_overwrites'
end

# @return [Channel, nil] the channel that was previously used in the server widget. Only present if the key for this change is `widget_channel_id`.
Expand Down

0 comments on commit dc27fe1

Please sign in to comment.