fixed shared chat bug
This commit is contained in:
parent
8a3bf1defe
commit
3c9b8f4bc9
2 changed files with 9 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ const defaultConfigs = (function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
|
listenAcrossSharedChat: false,
|
||||||
replyInChat: true, // true or false
|
replyInChat: true, // true or false
|
||||||
enableLimit: false, // true or false
|
enableLimit: false, // true or false
|
||||||
limit: 10, // integer
|
limit: 10, // integer
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,14 @@ function isStreamer(flags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ComfyJS.onCommand = (user, command, message, flags, extra) => {
|
ComfyJS.onCommand = (user, command, message, flags, extra) => {
|
||||||
|
if (!getSetting("listenAcrossSharedChat")) {
|
||||||
|
// Reject messages from another chat during shared chat if room information
|
||||||
|
// is present and doesn't match the current chat.
|
||||||
|
const { roomId, userState } = extra;
|
||||||
|
const sourceRoomId = userState["source-room-id"];
|
||||||
|
if (roomId && sourceRoomId && roomId !== sourceRoomId) return;
|
||||||
|
}
|
||||||
|
|
||||||
command = `!${command.toLowerCase()}`;
|
command = `!${command.toLowerCase()}`;
|
||||||
|
|
||||||
processCommand(user, command, message, flags, extra);
|
processCommand(user, command, message, flags, extra);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue