Compare commits
2 Commits
6f2a5e03e9
...
2e54d38383
Author | SHA1 | Date |
---|---|---|
|
2e54d38383 | |
|
98a1aa8fff |
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.26.10",
|
"version": "1.26.11",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.26.10",
|
"version": "1.26.11",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^8.3.0",
|
"better-sqlite3": "^8.3.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.26.10",
|
"version": "1.26.11",
|
||||||
"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": {
|
||||||
|
|
|
@ -2,17 +2,31 @@
|
||||||
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
|
|
||||||
|
const style = require('../utils/style');
|
||||||
|
|
||||||
function onCommand(args, context) {
|
function onCommand(args, context) {
|
||||||
if (config.platform === 'schat') {
|
if (config.platform === 'schat') {
|
||||||
context.sendMessage('Shutting down... :sleeping:', context.room?.id, { type: 'message', label: false }, context.message.user?.username);
|
Object.keys(context.bot.rooms).forEach((roomId) => {
|
||||||
|
context.sendMessage(`Kill command used by ${style.bold(context.user.username)}, shutting down... :sleeping:`, roomId, { type: 'message', label: false });
|
||||||
|
});
|
||||||
|
|
||||||
|
if (context.message.user) {
|
||||||
|
context.sendMessage('Shutting down... :sleeping:', context.room?.id, { type: 'message', label: false }, context.message.user.username);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.platform === 'irc' && context.room.id === config.user.id) {
|
if (context.platform === 'irc') {
|
||||||
|
Object.keys(context.bot.rooms).forEach((roomId) => {
|
||||||
|
context.sendMessage(`Kill command used by ${style.bold(context.user.username)}, shutting down... :sleeping:`, roomId, { type: 'message', label: false });
|
||||||
|
});
|
||||||
|
|
||||||
|
if (context.room.id === config.user.id) {
|
||||||
// if the room ID is the bot's own nickname, it's a PM and we should reply to the sender
|
// if the room ID is the bot's own nickname, it's a PM and we should reply to the sender
|
||||||
context.sendMessage('Shutting down... 😴', context.user.id, { label: false });
|
context.sendMessage('Shutting down... 😴', context.user.id, { label: false });
|
||||||
} else if (config.platform === 'irc') {
|
} else {
|
||||||
context.sendMessage('Shutting down... 😴', context.room?.id, { type: 'message', label: false });
|
context.sendMessage('Shutting down... 😴', context.room?.id, { type: 'message', label: false });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
context.logger.info(`Kill command used by ${context.user.username}`);
|
context.logger.info(`Kill command used by ${context.user.username}`);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue