Improve username tagging on leaderboard

This commit is contained in:
Max Wofford 2025-02-23 22:42:37 -05:00
parent b915b8f0c7
commit 560c7f33c4
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ class SailorsLogNotifyJob < ApplicationJob
hours = project_duration / 3600
message = ":boat: <@#{SlackUsername.find_by_uid(slack_uid)}> just coded 1 more hour on *#{project_name}* (total: #{hours}hrs). _#{kudos_message}_"
message = ":boat: `@#{SlackUsername.find_by_uid(slack_uid)}` just coded 1 more hour on *#{project_name}* (total: #{hours}hrs). _#{kudos_message}_"
response = HTTP.auth("Bearer #{ENV['SAILORS_LOG_SLACK_BOT_OAUTH_TOKEN']}")
.post("https://slack.com/api/chat.postMessage",

View file

@ -12,7 +12,7 @@ class SailorsLogLeaderboard < ApplicationRecord
stats.each_with_index do |entry, index|
medal = medals[index] || "white_small_square"
msg += "\n:#{medal}: `<@#{SlackUsername.find_by_uid(entry[:user_id])}>`: #{short_time_simple entry[:duration]}"
msg += "\n:#{medal}: `@#{SlackUsername.find_by_uid(entry[:user_id])}`: #{short_time_simple entry[:duration]}"
msg += entry[:projects].map do |project|
language = project[:language_emoji] ? "#{project[:language_emoji]} #{project[:language]}" : project[:language]