Skip to content

Commit 1c19c99

Browse files
committed
Added new config option and removed the unknown command message
1 parent 430d66b commit 1c19c99

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"refreshScene": "REFRESH",
99
"lowBitrateTrigger": 1000,
1010
"refreshSceneInterval": 10000,
11-
"requestMs": 2000
11+
"requestMs": 2000,
12+
"onlySwitchWhenStreaming": true
1213
},
1314
"nginx": {
1415
"rtmp": "rtmp://localhost/publish/live"

lib/components/Chat.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ function () {
146146
this[commandName](parse[1]);
147147
log.success("".concat(parsed.username, " Executed ").concat(commandName, " command"));
148148
this.setWait();
149-
} else {
150-
log.error("".concat(parsed.username, " Executed unknown command ").concat(commandName));
151149
}
152150
}
153151
} else if (parsed.command === "PING") {

lib/components/ObsSwitcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function (_EventEmitter) {
128128
while (1) {
129129
switch (_context.prev = _context.next) {
130130
case 0:
131-
if (_this2.obsStreaming) {
131+
if (!(!_this2.obsStreaming && (_config.default.obs.onlySwitchWhenStreaming == null || _config.default.obs.onlySwitchWhenStreaming))) {
132132
_context.next = 2;
133133
break;
134134
}

src/components/Chat.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ class Chat {
138138

139139
log.success(`${parsed.username} Executed ${commandName} command`);
140140
this.setWait();
141-
} else {
142-
log.error(`${parsed.username} Executed unknown command ${commandName}`);
143141
}
144142
}
145143
} else if (parsed.command === "PING") {

src/components/ObsSwitcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ObsSwitcher extends EventEmitter {
5858
this.getSceneList();
5959

6060
this.interval = setInterval(async () => {
61-
if (!this.obsStreaming) return;
61+
if (!this.obsStreaming && (config.obs.onlySwitchWhenStreaming == null || config.obs.onlySwitchWhenStreaming)) return;
6262

6363
const bitrate = await this.getBitrate();
6464
const { currentScene, canSwitch } = await this.canSwitch();

0 commit comments

Comments
 (0)