mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +00:00
4.47.0
* Added: `/ffz reload` command to reload emote and badge data without reloading the page. (Note: Add-ons will need to update to add support for the command.) * Changed: Improve monitor support for Current Monitor, specifically when a user has multiple monitors with the same name. * Fixed: Track the loaded status of global FFZ badges when loading chat data. * Fixed: The page scrolling incorrectly when using the FFZ emote menu in some situations.
This commit is contained in:
parent
9381c17e71
commit
e6ad12c937
11 changed files with 219 additions and 18 deletions
|
@ -2161,7 +2161,7 @@ export default class ChatHook extends Module {
|
|||
room = room.toLowerCase();
|
||||
|
||||
for(const inst of this.ChatService.instances) {
|
||||
if ( inst.props.channelLogin.toLowerCase() === room ) {
|
||||
if ( room === '*' || inst.props.channelLogin.toLowerCase() === room ) {
|
||||
inst.addMessage({
|
||||
type: this.chat_types.Notice,
|
||||
message
|
||||
|
@ -2228,11 +2228,39 @@ export default class ChatHook extends Module {
|
|||
msg = msg.replace(/\s+/g, ' ');
|
||||
|
||||
if ( msg.startsWith('/ffz') ) {
|
||||
inst.addMessage({
|
||||
type: t.chat_types.Notice,
|
||||
message: 'The /ffz command is not yet re-implemented.'
|
||||
msg = msg.slice(5).trim();
|
||||
const idx = msg.indexOf(' ');
|
||||
let subcmd;
|
||||
if ( idx === -1 ) {
|
||||
subcmd = msg;
|
||||
msg = '';
|
||||
} else {
|
||||
subcmd = msg.slice(0, idx);
|
||||
msg = msg.slice(idx + 1).trimStart();
|
||||
}
|
||||
|
||||
const event = new FFZEvent({
|
||||
command: subcmd,
|
||||
message: msg,
|
||||
extra,
|
||||
context: t.chat.context,
|
||||
channel: inst.props.channelLogin,
|
||||
_inst: inst,
|
||||
addMessage,
|
||||
sendMessage
|
||||
});
|
||||
|
||||
const topic = `chat:ffz-command:${subcmd}`,
|
||||
listeners = t.listeners(topic);
|
||||
|
||||
if ( listeners?.length > 0 )
|
||||
t.emit(topic, event);
|
||||
else
|
||||
inst.addMessage({
|
||||
type: t.chat_types.Notice,
|
||||
message: t.i18n.t('chat.ffz-command.invalid', 'No such command: /ffz {subcmd}', {subcmd})
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue