Skip to content

Instantly share code, notes, and snippets.

View velitchko's full-sized avatar
🎧
Focusing

Velitchko Filipov velitchko

🎧
Focusing
View GitHub Profile
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] + " ";
}
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var userSchema = new Schema({
username: {
type: String,
required: true
},
server: String,
lines: {