mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 05:15:54 +00:00
4.46.2
* Added: Command to manually force chat to `/reconnect`. (This was actually added in the last version, but I forgot to include it in the change log.) * Fixed: Rich embeds for links not appearing.
This commit is contained in:
parent
5956312ae3
commit
9381c17e71
3 changed files with 36 additions and 20 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"author": "Dan Salvato LLC",
|
"author": "Dan Salvato LLC",
|
||||||
"version": "4.46.1",
|
"version": "4.46.2",
|
||||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|
|
@ -2056,7 +2056,7 @@ export default class Chat extends Module {
|
||||||
const want_mid = this.context.get('chat.rich.want-mid');
|
const want_mid = this.context.get('chat.rich.want-mid');
|
||||||
|
|
||||||
for(const token of tokens) {
|
for(const token of tokens) {
|
||||||
if ( token.allow_rich )
|
if ( token.allow_rich ?? true )
|
||||||
for(const provider of providers)
|
for(const provider of providers)
|
||||||
if ( provider.test.call(this, token, msg) ) {
|
if ( provider.test.call(this, token, msg) ) {
|
||||||
token.hidden = provider.can_hide_token && (this.context.get('chat.rich.hide-tokens') || provider.hide_token);
|
token.hidden = provider.can_hide_token && (this.context.get('chat.rich.hide-tokens') || provider.hide_token);
|
||||||
|
|
|
@ -1038,6 +1038,39 @@ export default class ChatHook extends Module {
|
||||||
this.updateLineBorders();
|
this.updateLineBorders();
|
||||||
//this.updateMentionCSS();
|
//this.updateMentionCSS();
|
||||||
|
|
||||||
|
this.on('chat:get-tab-commands', e => {
|
||||||
|
e.commands.push({
|
||||||
|
name: 'reconnect',
|
||||||
|
description: 'Force chat to reconnect.',
|
||||||
|
permissionLevel: 0,
|
||||||
|
ffz_group: 'FrankerFaceZ'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
this.on('chat:pre-send-message', e => {
|
||||||
|
const msg = e.message,
|
||||||
|
inst = e._inst;
|
||||||
|
|
||||||
|
if ( ! /^\/reconnect ?/i.test(msg) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ( ! inst.client?.reconnect )
|
||||||
|
inst.addMessage({
|
||||||
|
type: t.chat_types.Notice,
|
||||||
|
message: t.i18n.t('chat.reconnect.unable', 'FFZ is unable to force chat to reconnect.')
|
||||||
|
});
|
||||||
|
else {
|
||||||
|
inst.addMessage({
|
||||||
|
type: t.chat_types.Notice,
|
||||||
|
message: t.i18n.t('chat.reconnect', 'FFZ is forcing chat to reconnect...')
|
||||||
|
});
|
||||||
|
|
||||||
|
inst.client.reconnect();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.RaidController.on('mount', this.wrapRaidController, this);
|
this.RaidController.on('mount', this.wrapRaidController, this);
|
||||||
this.RaidController.on('update', this.noAutoRaids, this);
|
this.RaidController.on('update', this.noAutoRaids, this);
|
||||||
this.RaidController.ready((cls, instances) => {
|
this.RaidController.ready((cls, instances) => {
|
||||||
|
@ -2203,29 +2236,12 @@ export default class ChatHook extends Module {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( msg === '/reconnect' ) {
|
|
||||||
if ( ! inst.client?.reconnect )
|
|
||||||
inst.addMessage({
|
|
||||||
type: t.chat_types.Notice,
|
|
||||||
message: t.i18n.t('chat.reconnect.unable', 'FFZ is unable to force chat to reconnect.')
|
|
||||||
});
|
|
||||||
else {
|
|
||||||
inst.addMessage({
|
|
||||||
type: t.chat_types.Notice,
|
|
||||||
message: t.i18n.t('chat.reconnect', 'FFZ is forcing chat to reconnect...')
|
|
||||||
});
|
|
||||||
|
|
||||||
inst.client.reconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const event = new FFZEvent({
|
const event = new FFZEvent({
|
||||||
message: msg,
|
message: msg,
|
||||||
extra,
|
extra,
|
||||||
context: t.chat.context,
|
context: t.chat.context,
|
||||||
channel: inst.props.channelLogin,
|
channel: inst.props.channelLogin,
|
||||||
|
_inst: inst,
|
||||||
addMessage,
|
addMessage,
|
||||||
sendMessage
|
sendMessage
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue