From 7eb7f145a0bbd332f1f538b233c7f1dc240e6e0f Mon Sep 17 00:00:00 2001 From: hirata Date: Mon, 29 Sep 2025 09:32:51 +0900 Subject: [PATCH] Fix attendance command to be able to handle cases where trailing spaces are present. --- lib/swimmy/command/attendance.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swimmy/command/attendance.rb b/lib/swimmy/command/attendance.rb index c323fde..098fd75 100644 --- a/lib/swimmy/command/attendance.rb +++ b/lib/swimmy/command/attendance.rb @@ -8,7 +8,7 @@ class Attendance < Swimmy::Command::Base command 'hi', 'bye' do |client, data, match| cmd = match[:command] - arg = match[:expression] + arg = match[:expression]&.strip now = Time.now user = client.web_client.users_info(user: data.user).user user_id = user.id @@ -60,7 +60,7 @@ def self.parse_arg(arg) active_members = spreadsheet.sheet("members", Swimmy::Resource::Member).fetch.select {|m| m.active? }.map {|m| m.account } case arg - in nil + in nil | "" # return "do_current_user" if arg is not specified return "do_current_user" in String => s if active_members.include?(s)