Compare commits
No commits in common. "11dd4f2c53b88da8841bfff7bd34af19200e3f26" and "93ee8f1c170b33d37daee428df0c218b4975d18b" have entirely different histories.
11dd4f2c53
...
93ee8f1c17
|
@ -22,7 +22,7 @@ module.exports = {
|
||||||
greeting: 'Hi, I am aisha, your game host!',
|
greeting: 'Hi, I am aisha, your game host!',
|
||||||
usernamePrefix: '@',
|
usernamePrefix: '@',
|
||||||
channels: ['GamesNight'],
|
channels: ['GamesNight'],
|
||||||
games: ['mash', 'trivia', 'letters', 'duck', 'ping', 'say', 'kill', 'uptime', 'help'],
|
games: ['mash', 'trivia', 'letters', 'duck', 'ping', 'say', 'kill', 'help'],
|
||||||
schatColors: {
|
schatColors: {
|
||||||
red: 'red',
|
red: 'red',
|
||||||
orange: 'orange',
|
orange: 'orange',
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.14.0",
|
"version": "1.13.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.14.0",
|
"version": "1.13.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
"bottleneck": "^2.19.5",
|
"bottleneck": "^2.19.5",
|
||||||
"config": "^3.3.6",
|
"config": "^3.3.6",
|
||||||
"date-fns": "^2.29.3",
|
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
"inflect": "^0.5.0",
|
"inflect": "^0.5.0",
|
||||||
"irc": "^0.5.2",
|
"irc": "^0.5.2",
|
||||||
|
@ -1079,18 +1078,6 @@
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/date-fns": {
|
|
||||||
"version": "2.29.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
|
|
||||||
"integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.11"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/date-fns"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "2.6.9",
|
"version": "2.6.9",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
@ -4686,11 +4673,6 @@
|
||||||
"whatwg-url": "^10.0.0"
|
"whatwg-url": "^10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"date-fns": {
|
|
||||||
"version": "2.29.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
|
|
||||||
"integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA=="
|
|
||||||
},
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "2.6.9",
|
"version": "2.6.9",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.14.0",
|
"version": "1.13.0",
|
||||||
"description": "Game host for SChat 2-powered chat sites",
|
"description": "Game host for SChat 2-powered chat sites",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -21,7 +21,6 @@
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
"bottleneck": "^2.19.5",
|
"bottleneck": "^2.19.5",
|
||||||
"config": "^3.3.6",
|
"config": "^3.3.6",
|
||||||
"date-fns": "^2.29.3",
|
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
"inflect": "^0.5.0",
|
"inflect": "^0.5.0",
|
||||||
"irc": "^0.5.2",
|
"irc": "^0.5.2",
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const config = require('config');
|
|
||||||
const os = require('os');
|
|
||||||
const { intervalToDuration } = require('date-fns');
|
|
||||||
|
|
||||||
const start = Date.now();
|
|
||||||
|
|
||||||
function getDurationString(duration) {
|
|
||||||
return Object.entries(duration)
|
|
||||||
.filter(([, value]) => !!value)
|
|
||||||
.map(([key, value]) => `${value} ${key}`)
|
|
||||||
.join(', ');
|
|
||||||
}
|
|
||||||
|
|
||||||
function onCommand(args, context) {
|
|
||||||
const duration = intervalToDuration({ start, end: Date.now() });
|
|
||||||
const durationString = getDurationString(duration);
|
|
||||||
|
|
||||||
if (['sys', 'system'].includes(context.subcommand || args[0]) && config.operators.includes(context.user.username)) {
|
|
||||||
const osDuration = intervalToDuration({ start: 0, end: os.uptime() * 1000 });
|
|
||||||
const osDurationString = getDurationString(osDuration);
|
|
||||||
|
|
||||||
context.sendMessage(`I've been awake for ${durationString}. My host has been running for ${osDurationString}.`, context.room.id, null, context.message.user?.recipient);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
context.sendMessage(`I've been awake for ${durationString}.`, context.room.id, null, context.message.user?.recipient);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = { onCommand };
|
|
Loading…
Reference in New Issue