-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathbot-shutdown.js.example
More file actions
39 lines (38 loc) · 1.25 KB
/
bot-shutdown.js.example
File metadata and controls
39 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Simply add your Discord perosnal UserID under `bot.msg.[userID]` and remove breakets
//Please Note - User ID is not your username
/*let cmd = require('node-cmd');
let shell = require('shelljs');
let moment = require('moment-timezone');
let isWindows = require('check-if-windows');
let bot.msg.23585678352345 = require('../helpers.js').bot.msg.23585678352345;
let config = require('config');
let logChannel = config.get('moderation').logchannel;
let pm2Name = config.get('General').pm2Name;
exports.commands = ['shutdown'];
exports.shutdown = {
usage: '<pm2-name>',
description:
':desktop: :construction_worker: shuts down bot via pm2 :construction_worker: :desktop:',
process: function(bot, msg, suffix) {
if (bot.msg.23585678352345(msg)) {
if (suffix != pm2Name) {
return;
}
var time = moment()
.tz('America/Los_Angeles')
.format('MM-DD-YYYY hh:mm a');
msg.channel.send('Shutting Down pm2 app (' + pm2Name + ')');
bot.channels
.get(logChannel)
.send(
'[' + time + ' PST][' + pm2Name + '] Shutting Down pm2 app (veronica)'
);
if (isWindows) {
cmd.run('pm2 stop ' + pm2Name);
} else {
shell.exec('pm2 stop ' + pm2Name);
}
}
}
};
*/