1.4.4 Hotfix make sure socket.on is for self
This commit is contained in:
1 parent
ea546f4237
commit
d49bc4a0b4
3 files changed
+20
-2
No files matched your search
@@ -111,6 +111,7 @@ class Bot {
|
||||
this.socket.emit("bot_name_search", data);
|
||||
this.socket.on("bot_name_search_results", results => {
|
||||
|
||||
if (results.user._id==user._id) {
|
||||
if (results.civilians.length == 0) {
|
||||
return message.channel.send(`Name **${args[0]} ${args[1]}** not found ${message.author}`);
|
||||
}
|
||||
@@ -171,6 +172,7 @@ class Bot {
|
||||
nameResult.addFields({name:'**Veteran**',value:`**${results.civilians[i].civilian.veteran}**`,inline:true});
|
||||
message.channel.send(nameResult);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -188,6 +190,7 @@ class Bot {
|
||||
this.socket.emit('bot_plate_search', data);
|
||||
this.socket.on('bot_plate_search_results', results => {
|
||||
|
||||
if (results.user._id==user._id) {
|
||||
if (results.vehicles.length == 0) {
|
||||
return message.channel.send(`Plate Number **${args[0]}** not found ${message.author}`);
|
||||
}
|
||||
@@ -218,9 +221,24 @@ class Bot {
|
||||
if (stolen=='2') plateResult.addFields({ name: `**Stolen**`, value: `**Yes**`, inline: true });
|
||||
message.channel.send(plateResult);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// In Dev
|
||||
// async firearmSeach(message, args) {
|
||||
// let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user);
|
||||
// if (!user) return message.channel.send(`You are not logged in ${message.author}!`);
|
||||
// if (args.length==0) return message.channel.send(`You are missing a **Serial Number** ${message.author}`);
|
||||
// let data = {
|
||||
// user: user,
|
||||
// query: {
|
||||
// serialNumber: args[0],
|
||||
// activeCommunityID: user.user.activeCommunity
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
async checkStatus(message, args) {
|
||||
if (args.length==0) {
|
||||
let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"defaultPrefix": "?",
|
||||
"botID": "860298681047056434",
|
||||
"mongoURI": "mongodb+srv://lps_bot:ktSkHml2BU9EIQ0a@heroku-police-cad-dev.j7aom.mongodb.net/heroku_8pc4g86l?retryWrites=true&w=majority",
|
||||
"version": "Beta 1.4.3",
|
||||
"version": "Beta 1.4.4",
|
||||
"socket": "https://police-cad-dev.herokuapp.com/",
|
||||
"dbo": "heroku_8pc4g86l"
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"defaultPrefix": "?",
|
||||
"botID": "860298681047056434",
|
||||
"mongoURI": "mongodb+srv://lps_bot:ktSkHml2BU9EIQ0a@heroku-police-cad-dev.j7aom.mongodb.net/heroku_8pc4g86l?retryWrites=true&w=majority",
|
||||
"version": "Beta 1.4.3",
|
||||
"version": "Beta 1.4.4",
|
||||
"socket": "http://localhost:8080",
|
||||
"dbo": "heroku_8pc4g86l"
|
||||
}
|
||||
Reference in new issue
Block a user