This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addNotifyToAllAccounts(input, sender) { | |
console.log("Trying to find user"); | |
User.find({ username: input[1] }, function(err, userdb) { | |
if(!err && userdb){ | |
console.log("Found user: " + userdb[0].username); | |
let newNotification = ''; | |
// rebuilding message | |
for(var i = 2; i < input.length; i++){ | |
newNotification += input[i] + " "; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var userSchema = new Schema({ | |
username: { | |
type: String, | |
required: true | |
}, | |
server: String, | |
lines: { |