Closed Xruptor closed 2 years ago
hello Xruptor. About the spaces, isn't an issue, you created them on purpose, just look at yours vars, there are whitespaces that were created by you.
hello Xruptor. About the spaces, isn't an issue, you created them on purpose, just look at yours vars, there are whitespaces that were created by you.
I normally space out code so its easier to read. I didn't think that would play a major role as part of the assignment. Thanks,
For future issues , suggestions or any type of help. We recommend to join our discord server https://ccommandbot.com/join
There is currently an issue where storing any roleID or userID has beginning and trailing whitespaces in the variable. This causes an error for functions such as $hasRoles.
Example
assume the following: x_Usr = 50000000000 x_Visitor= 70000000000 x_FCMember= 90000000000
Using this code:
The following block:
will return the following:
The following code:
$hasRoles[$x_Usr;$x_Visitor]
Will return the error :x: Invalid user ID in $hasRoles[ 50000000000 ; 70000000000 ] Because there are white spaces in the front and end of the variables.
In order to get around this you have to remove the white spaces.
testme$replaceTextWithRegex[$x_Usr;\s;gi;]
Will return testme50000000000 with no whitespaces.That means in order to properly use the $hasRoles function you have to do it like this
$hasRoles[$replaceTextWithRegex[$x_Usr;\s;gi;];$replaceTextWithRegex[$x_Visitor;\s;gi;]]
Suggestion: 1) You can have the $hasRoles ignore whitespaces 2) put a $trim function to remove whitespaces from variables such as $trim[$x_Usr] 3) you can make variable returns using $variable or $get not return with whitespaces in the front or back using an optional variable. $get[x_Visitor;yes] where yes would be to trim whitespaces