Debug added to say.

This commit is contained in:
Storm Dragon
2025-11-20 12:42:16 -05:00
parent 2a2f24ab6d
commit d801547bb2

View File

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