diff --git a/nextcloud_talk_manager.sh b/nextcloud_talk_manager.sh index 8b5392f..349485b 100755 --- a/nextcloud_talk_manager.sh +++ b/nextcloud_talk_manager.sh @@ -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..." }