Only taking room argument for Say when command is used in PM.
This commit is contained in:
parent
276547cecb
commit
e055eebbea
|
@ -2,14 +2,14 @@
|
|||
|
||||
const config = require('config');
|
||||
|
||||
function onCommand([rawRoomName, ...words], context) {
|
||||
function onCommand(args, context) {
|
||||
if (!config.operators?.includes(context.user.username)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const roomName = rawRoomName.replace(/#+/, '');
|
||||
const message = words.join(' ');
|
||||
const room = Object.values(context.bot.rooms).find((botRoom) => botRoom.name === roomName);
|
||||
const message = context.room ? args.join(' ') : args.slice(1).join(' ');
|
||||
const roomName = args[0].replace(/#+/, '');
|
||||
const room = context.room || Object.values(context.bot.rooms).find((botRoom) => botRoom.name === roomName);
|
||||
|
||||
if (!room) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue