Skip to content
Snippets Groups Projects
Verified Commit 3affcdb4 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Improve simple bot output

No longer prints a seconds value marked as milliseconds
parent fea6ec98
No related branches found
No related tags found
No related merge requests found
Pipeline #15344 passed
...@@ -74,7 +74,7 @@ class MatrixBot ...@@ -74,7 +74,7 @@ class MatrixBot
origin_ts = Time.at(message[:origin_server_ts] / 1000.0) origin_ts = Time.at(message[:origin_server_ts] / 1000.0)
diff = Time.now - origin_ts diff = Time.now - origin_ts
puts "[#{Time.now.strftime '%H:%M'}] <#{sender.id} in #{room.id} @ #{diff}ms> \"#{message.content[:body]}\"" puts "[#{Time.now.strftime '%H:%M'}] <#{sender.id} in #{room.id} @ #{(diff * 1000).round(2)}ms> \"#{message.content[:body]}\""
plaintext = '%<sender>s: Pong! (ping%<msg>s took %<time>s to arrive)' plaintext = '%<sender>s: Pong! (ping%<msg>s took %<time>s to arrive)'
html = '<a href="https://matrix.to/#/%<sender>s">%<sender>s</a>: Pong! (<a href="https://matrix.to/#/%<room>s/%<event>s">ping</a>%<msg>s took %<time>s to arrive)' html = '<a href="https://matrix.to/#/%<sender>s">%<sender>s</a>: Pong! (<a href="https://matrix.to/#/%<room>s/%<event>s">ping</a>%<msg>s took %<time>s to arrive)'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment