Class: ESM::Command::Server::Logs
- Inherits:
-
ApplicationCommand
- Object
- Base
- ApplicationCommand
- ESM::Command::Server::Logs
- Defined in:
- lib/esm/command/server/logs.rb
Defined Under Namespace
Modules: V1
Constant Summary collapse
- TRANSLATED_MONTHS =
Handles German, Italian, Spanish, and French
{ "gen" => "jan", "ene" => "jan", "fév" => "feb", "mär" => "mar", "abr" => "apr", "avr" => "apr", "mai" => "may", "mag" => "may", "juin" => "jun", "giu" => "jun", "lug" => "jul", "juil" => "jul", "aoû" => "aug", "ago" => "aug", "set" => "sep", "ott" => "oct", "okt" => "oct", "dic" => "dec", "dez" => "dec", "déc" => "dec" }.freeze
Instance Method Summary collapse
Instance Method Details
#on_execute ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/esm/command/server/logs.rb', line 59 def on_execute # If the target was given, check to make sure they're registered and then set the steam_uid search = if target_user check_for_registered_target_user! if target_user.is_a?(ESM::User) target_user.steam_uid else # Escape any regex in the "search query" Regexp.quote(arguments.target) end = ESM::Message.new.set_type(:search).set_data(search:) log_results = send_to_target_server!().data.results check_for_no_logs!(log_results) log = ESM::Log.create!( server_id: target_server.id, search_text: arguments.target, requestors_user_id: current_user.id ) create_log_entries(log, log_results) = ESM::Embed.build do |e| e.title = "Log parsing for `#{target_server.server_id}` completed" e.description = <<~STRING You may review the results here: #{log.link} _Link expires on `#{log.expires_at.strftime(ESM::Time::Format::TIME)}`_ STRING end reply() end |