🐛 Server > Fix alert

This commit is contained in:
brunosimon
2017-12-24 13:25:10 +01:00
parent 034f6910fb
commit 0ba869f0eb
4 changed files with 20 additions and 9 deletions
+4 -8
View File
@@ -1,7 +1,5 @@
const ids = require('./ids.js')
const robotNames = require('./assets/data/robot-names.json')
const nodeNotifier = require('node-notifier')
const path = require('path')
const HTMLEntities = require('html-entities')
class Chat
@@ -10,6 +8,8 @@ class Chat
{
this.config = _config
this.slug = _options.slug
this.watcherSocket = _options.watcherSocket
this.users = {}
this.messages = []
this.availableRobotNames = this.shuffle(robotNames.slice())
@@ -100,12 +100,8 @@ class Chat
// On alert
socket.on('alert', () =>
{
nodeNotifier.notify({
title: 'Keppler',
message: 'Alert!',
icon: path.join(__dirname, 'assets/images/notification-icon-200x200.png'),
wait: true
})
// Transfer to the watcher socket
this.watcherSocket.emit('alert')
// Debug
if(this.config.debug >= 1)