🐛 Server > Fix alert
This commit is contained in:
+4
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user