Compare commits
2 Commits
276547cecb
...
7640fae9d8
Author | SHA1 | Date |
---|---|---|
|
7640fae9d8 | |
|
e055eebbea |
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.10",
|
"version": "1.5.11",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.10",
|
"version": "1.5.11",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.10",
|
"version": "1.5.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,14 +2,14 @@
|
||||||
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
|
|
||||||
function onCommand([rawRoomName, ...words], context) {
|
function onCommand(args, context) {
|
||||||
if (!config.operators?.includes(context.user.username)) {
|
if (!config.operators?.includes(context.user.username)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const roomName = rawRoomName.replace(/#+/, '');
|
const message = context.room ? args.join(' ') : args.slice(1).join(' ');
|
||||||
const message = words.join(' ');
|
const roomName = args[0].replace(/#+/, '');
|
||||||
const room = Object.values(context.bot.rooms).find((botRoom) => botRoom.name === roomName);
|
const room = context.room || Object.values(context.bot.rooms).find((botRoom) => botRoom.name === roomName);
|
||||||
|
|
||||||
if (!room) {
|
if (!room) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue