diff --git a/src/chatTweaks/index.ts b/src/chatTweaks/index.ts index 994bae6..5d3c1b0 100644 --- a/src/chatTweaks/index.ts +++ b/src/chatTweaks/index.ts @@ -1,5 +1,7 @@ import { Patch } from "@moonlight-mod/types"; +let webhookTag = () => moonlight.getConfigOption("chatTweaks", "webhookTag") ?? true; + export const patches: Patch[] = [ // no reply mention { @@ -19,6 +21,34 @@ export const patches: Patch[] = [ replacement: (_, showThreadPromptOnReply) => `=(moonlight.getConfigOption("chatTweaks","noReplyChainNag")??true?false:${showThreadPromptOnReply})&&` } + }, + + // revert app to bot + { + find: ".BOT:default:", + replace: { + match: "9RNkeH", // APP_TAG + replacement: "PQt9z8" // BOT_TAG_BOT + }, + prerequisite: () => moonlight.getConfigOption("chatTweaks", "appToBot") ?? true + }, + + // webhook tag + { + find: ".BOT:default:", + replace: { + match: /case .\..{1,3}\.BOT:default:(.)=/, + replacement: (orig, tag) => `case 99:${tag}="WEBHOOK";break;${orig}` + }, + prerequisite: webhookTag + }, + { + find: ".Types.ORIGINAL_POSTER", + replace: { + match: /(.)=.\.Z\.Types\.ORIGINAL_POSTER\),/, + replacement: (orig, type) => + `${orig}(arguments[0].user?.bot&&arguments[0].message?.webhookId&&arguments[0].user?.isNonUserBot?.()&&(${type}=99)),` + }, + prerequisite: webhookTag } ]; - diff --git a/src/chatTweaks/manifest.json b/src/chatTweaks/manifest.json index 1509806..81644cd 100644 --- a/src/chatTweaks/manifest.json +++ b/src/chatTweaks/manifest.json @@ -1,7 +1,7 @@ { "$schema": "https://moonlight-mod.github.io/manifest.schema.json", "id": "chatTweaks", - "version": "1.0.0", + "version": "1.0.1", "meta": { "name": "Chat Tweaks", "tagline": "Various tweaks to chatting. Every feature togglable.", @@ -30,6 +30,32 @@ "description": "Removes the extra bar of text when replying to a chain of replies over 4 messages.", "type": "boolean", "default": true + }, + "appToBot": { + "displayName": "App to Bot", + "description": "Revert bot tags back to saying bot", + "type": "boolean", + "default": true + }, + "webhookTag": { + "displayName": "Webhook Tag", + "type": "boolean", + "default": true + }, + "jumpToBlocked": { + "displayName": "Allow jumping to blocked/ignored messages", + "type": "boolean", + "default": true + }, + "hideBlocked": { + "displayName": "Hide blocked messages completely", + "type": "boolean", + "default": false + }, + "hideIgnored": { + "displayName": "Hide ignored messages completely", + "type": "boolean", + "default": false } }, "apiLevel": 2