Skip to content

Commit 0d96fef

Browse files
committed
Fixed 'user not found' bug
1 parent fa0e101 commit 0d96fef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/user.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ echo -e "\nFetching..."
2020

2121
uid="$(curl -s https://api.roblox.com/users/get-by-username?username=${name} | jq '.Id')"
2222

23-
if [ ${uid} -lt 1 ]
23+
data="$(curl -s https://users.roblox.com/v1/users/${uid})"
24+
25+
if [ "$(echo ${data} | jq '.name' | tr --delete '\"')" == "null" ]
2426
then
25-
echo "No users with this name were found. Check your spelling and try again!"
27+
echo -e "Failed!\n\nNo users with this name were found. Check your spelling and try again!\n"
2628
exit
2729
fi
2830

29-
data="$(curl -s https://users.roblox.com/v1/users/${uid})"
3031
echo "Done!"
3132

3233
cat << EOF
@@ -40,4 +41,4 @@ Creation date: $(echo ${data} | jq ".created" | tr --delete '\"')
4041
Past usernames: $(curl -s https://users.roblox.com/v1/users/${uid}/username-history | jq '.data[] | .[]' | tr --delete '\"' | tr '\n' ' ')
4142
Profile: https://roblox.com/users/${uid}/profile
4243
43-
EOF
44+
EOF

0 commit comments

Comments
 (0)