Skip to content

Commit

Permalink
bot stats sbf
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRuiz committed Feb 14, 2022
1 parent f1a331e commit 33a386c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/slack/smart-bot/commands/on_bot/general/bot_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,7 @@ def bot_stats(dest, from_user, typem, channel_id, from, to, user, st_command, ex
if count_channels_dest.size > 10 and all_data
count_channels_dest.each do |ch, value|
channel_info = @channels_list.select { |c| c.name.to_s.downcase == ch.to_s.downcase}[-1]
if @channels_id.key?(ch) and !channel_info.is_private
c = "<##{@channels_id[ch]}>"
else
c = ch
end
channels_dest_attachment << "\t#{c}: #{value} (#{(value.to_f*100/total).round(2)}%)"
channels_dest_attachment << "\t##{ch}: #{value} (#{(value.to_f*100/total).round(2)}%)"
end
end
Expand Down Expand Up @@ -319,7 +314,7 @@ def bot_stats(dest, from_user, typem, channel_id, from, to, user, st_command, ex
message << "\t#{user_link}: #{count} (#{(count.to_f*100/total).round(2)}%)"
end
if users.size > 10 and all_data
users_attachment << "\t#{user_link}: #{count} (#{(count.to_f*100/total).round(2)}%)"
users_attachment << "\t#{users_id_name[user]}: #{count} (#{(count.to_f*100/total).round(2)}%)"
end
end
end
Expand Down

0 comments on commit 33a386c

Please sign in to comment.