FINAL FIX: Korrigierte Syntax für alle talk:room:* Befehle

- talk:room:create --public NAME (statt --type)
- talk:room:add TOKEN USERNAME (statt --user USERNAME TOKEN)
- talk:room:remove TOKEN USERNAME (statt --user USERNAME TOKEN)
- talk:room:promote TOKEN USERNAME (statt --user USERNAME TOKEN)
- talk:room:demote TOKEN USERNAME (statt --user USERNAME TOKEN)
- Typ-Auswahl entfernt (nur public Chats)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
wralto-user-1
2026-10-30 17:19:24 +01:00
parent 5f33e48fe7
commit 851adf78df

View File

@ -105,12 +105,10 @@ create_chat() {
echo -e "\n${YELLOW}Chat anlegen${NC}\n"
read -p "Name des Chats: " chat_name
[ -z "$chat_name" ] && echo -e "${RED}Fehler: Name leer!${NC}" && read -p "Enter..." && return
read -p "Typ (public/private/group): [public] " chat_type
chat_type=${chat_type:-public}
read -p "Nutzer hinzufügen (Komma-getrennt, optional): " users_to_add
echo -e "\nBefehl: $NC_OCC talk:room:create \"$chat_name\" --type=$chat_type"
local result=$($NC_OCC talk:room:create "$chat_name" --type="$chat_type" 2>&1)
echo -e "\nBefehl: $NC_OCC talk:room:create --public \"$chat_name\""
local result=$($NC_OCC talk:room:create --public "$chat_name" 2>&1)
echo "$result"
local room_token=$(echo "$result" | grep -oE '[a-zA-Z0-9]{8,}')
@ -122,8 +120,8 @@ create_chat() {
user=$(echo "$user" | tr -d ' ')
if validate_user "$user"; then
echo "Füge $user hinzu..."
echo " Befehl: $NC_OCC talk:room:add --user $user $room_token"
$NC_OCC talk:room:add --user "$user" "$room_token" 2>&1
echo " Befehl: $NC_OCC talk:room:add $room_token $user"
$NC_OCC talk:room:add "$room_token" "$user" 2>&1
else
echo -e " ${RED}Nutzer existiert nicht${NC}"
fi
@ -151,8 +149,8 @@ add_user_to_chat() {
echo -e "${RED}Chat existiert nicht!${NC}"
read -p "Enter..." && return
fi
echo -e "\nBefehl: $NC_OCC talk:room:add --user $username $room_token"
$NC_OCC talk:room:add --user "$username" "$room_token" 2>&1
echo -e "\nBefehl: $NC_OCC talk:room:add $room_token $username"
$NC_OCC talk:room:add "$room_token" "$username" 2>&1
read -p "Enter..."
}
@ -172,8 +170,8 @@ remove_user_from_chat() {
echo -e "${RED}Chat existiert nicht!${NC}"
read -p "Enter..." && return
fi
echo -e "\nBefehl: $NC_OCC talk:room:remove --user $username $room_token"
$NC_OCC talk:room:remove --user "$username" "$room_token" 2>&1
echo -e "\nBefehl: $NC_OCC talk:room:remove $room_token $username"
$NC_OCC talk:room:remove "$room_token" "$username" 2>&1
read -p "Enter..."
}
@ -193,8 +191,8 @@ make_moderator() {
echo -e "${RED}Chat existiert nicht!${NC}"
read -p "Enter..." && return
fi
echo -e "\nBefehl: $NC_OCC talk:room:promote --user $username $room_token"
$NC_OCC talk:room:promote --user "$username" "$room_token" 2>&1
echo -e "\nBefehl: $NC_OCC talk:room:promote $room_token $username"
$NC_OCC talk:room:promote "$room_token" "$username" 2>&1
read -p "Enter..."
}
@ -214,8 +212,8 @@ remove_moderator() {
echo -e "${RED}Chat existiert nicht!${NC}"
read -p "Enter..." && return
fi
echo -e "\nBefehl: $NC_OCC talk:room:demote --user $username $room_token"
$NC_OCC talk:room:demote --user "$username" "$room_token" 2>&1
echo -e "\nBefehl: $NC_OCC talk:room:demote $room_token $username"
$NC_OCC talk:room:demote "$room_token" "$username" 2>&1
read -p "Enter..."
}