24 lines
511 B
JavaScript
24 lines
511 B
JavaScript
'use strict';
|
|
|
|
const config = require('config');
|
|
|
|
function onCommand(args, context) {
|
|
if (!config.operators?.includes(context.user.username)) {
|
|
return;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
context.sendMessage(message, room.id, { label: false });
|
|
}
|
|
|
|
module.exports = {
|
|
onCommand,
|
|
};
|