✨ Add alert
This commit is contained in:
+19
-2
@@ -1,7 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const ids = require('./ids.js')
|
||||
const robotNames = require('./robot-names.json')
|
||||
const nodeNotifier = require('node-notifier')
|
||||
const path = require('path')
|
||||
|
||||
class Chat
|
||||
{
|
||||
@@ -94,6 +94,23 @@ 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
|
||||
})
|
||||
|
||||
// Debug
|
||||
if(this.config.debug >= 1)
|
||||
{
|
||||
console.log('chat > socket'.green.bold + ' - ' + 'alert'.cyan + ' - ' + user.name.cyan)
|
||||
}
|
||||
})
|
||||
|
||||
// On disconnect
|
||||
socket.on('disconnect', () =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user