WIP
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
function DBAddG(user,position) {
|
||||
if(guesses[user] && guesses[user].length > 0){
|
||||
}else{
|
||||
}else if(isCoordinates(position)){
|
||||
guesses[user] = position;
|
||||
$.inidb.SetString("chatguessr", "guesses", JSON.stringify(guesses));
|
||||
sendData('guesses',guesses);
|
||||
@@ -31,6 +31,11 @@
|
||||
}));
|
||||
}
|
||||
|
||||
function isCoordinates(coordinates) {
|
||||
const regex = /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/g;
|
||||
return regex.test(coordinates);
|
||||
};
|
||||
|
||||
$.bind('command', function(event) {
|
||||
|
||||
const sender = "" + event.getSender().toLowerCase(),
|
||||
|
Reference in New Issue
Block a user