Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum 61af290780 1.9.2 2022-10-21 05:21:29 +02:00
ThePendulum a9347ddd3a Adapted kill command for IRC. 2022-10-21 05:21:27 +02:00
3 changed files with 15 additions and 9 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.9.1",
"version": "1.9.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.9.1",
"version": "1.9.2",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.9.1",
"version": "1.9.2",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

View File

@ -1,12 +1,18 @@
'use strict';
const config = require('config');
function onCommand(args, context) {
context.bot.socket.transmit('message', {
roomId: context.room?.id,
recipient: context.message.user?.username,
body: 'Shutting down... :sleeping:',
style: config.style,
});
if (config.platform === 'schat') {
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.nick) {
// 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 });
} else if (config.platform === 'irc') {
context.sendMessage('Shutting down... 😴', context.room?.id, { type: 'message', label: false });
}
context.logger.info(`Kill command used by ${context.user.username}`);