diff --git a/modules/say/say.sh b/modules/say/say.sh index 11b8900..9673824 100755 --- a/modules/say/say.sh +++ b/modules/say/say.sh @@ -7,6 +7,9 @@ userName="$1" channelName="$2" shift 2 +# Debug logging +echo "DEBUG say.sh: userName='$userName' channelName='$channelName' args='$*'" >> "$log" + # Check if there are any arguments if [[ -z "$*" ]]; then msg "$channelName" "$userName: Please provide a message to say." @@ -23,8 +26,10 @@ fi if [[ "$channelName" == "$userName" ]]; then # PM context: check if first argument is a channel name firstArg="$1" + echo "DEBUG say.sh: PM context detected, firstArg='$firstArg'" >> "$log" # Check if first argument starts with # (explicit channel) + # IRC channels can contain: alphanumeric, -, _, and some special chars if [[ "$firstArg" =~ ^#[a-zA-Z0-9_-]+$ ]]; then # Remove # prefix for comparison with configured channels targetChannel="${firstArg#\#}"