Reorganization to hopefully prevent git conflicts.

This commit is contained in:
Storm Dragon
2025-10-25 01:30:02 -04:00
parent f6990bcc81
commit d684623974
13 changed files with 296 additions and 77 deletions

View File

@@ -1,16 +1,26 @@
#!/usr/bin/env bash
[ -f functions.sh ] && source functions.sh
greetingsFile="triggers/greet/greetings.txt"
# All names to match are completely lowercase.
case "${1,,}" in
storm_dragon)
msg "$2" "my lord, $1: how may I serve you?"
;;
*)
greeting=(
Greetings
"Howdy, welcome to $2!"
"Wazzup Moe Fugger!"
"Welcome to $2!"
)
msg "$2" "$1: ${greeting[$(($RANDOM % ${#greeting[@]}))]}"
# Read greetings from file into array
if [[ -f "$greetingsFile" ]]; then
mapfile -t greeting < "$greetingsFile"
else
# Fallback if file doesn't exist
greeting=("Greetings" "Welcome!")
fi
# Replace {channel} placeholder with actual channel name
selectedGreeting="${greeting[$((RANDOM % ${#greeting[@]}))]}"
selectedGreeting="${selectedGreeting//\{channel\}/$2}"
msg "$2" "$1: $selectedGreeting"
;;
esac

View File

@@ -0,0 +1,4 @@
Greetings
Howdy, welcome to {channel}!
Wazzup Moe Fugger!
Welcome to {channel}!