aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fxTwitter.ts
diff options
context:
space:
mode:
authorBerlin <39058370+somerandomcloud@users.noreply.github.com>2022-10-14 18:13:13 +0200
committerGitHub <noreply@github.com>2022-10-14 18:13:13 +0200
commitd73a6e2c8979ba0536452bfb19586556fe032aca (patch)
treee300bff2c01b15a271592163654290401675df11 /src/plugins/fxTwitter.ts
parent2cb6c23347e3305ee04367c2bf2d6e6603a09839 (diff)
downloadVencord-d73a6e2c8979ba0536452bfb19586556fe032aca.tar.gz
Vencord-d73a6e2c8979ba0536452bfb19586556fe032aca.tar.bz2
Vencord-d73a6e2c8979ba0536452bfb19586556fe032aca.zip
Fix fxTwitter regex (#100)
* Fixes so that wont affect other things like likes * Fixes #97 Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/fxTwitter.ts')
-rw-r--r--src/plugins/fxTwitter.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/fxTwitter.ts b/src/plugins/fxTwitter.ts
index 0cf19be..53477d2 100644
--- a/src/plugins/fxTwitter.ts
+++ b/src/plugins/fxTwitter.ts
@@ -2,6 +2,8 @@ import definePlugin from "../utils/types";
import { addPreSendListener, MessageObject, removePreSendListener } from "../api/MessageEvents";
import { Devs } from "../utils/constants";
+const re = /https?:\/\/twitter\.com(?=\/\w+?\/status\/)/g;
+
export default definePlugin({
name: "FxTwitter",
description: "Uses FxTwitter to improve embeds from twitter on send",
@@ -9,7 +11,7 @@ export default definePlugin({
dependencies: ["MessageEventsAPI"],
addPrefix(msg: MessageObject) {
- msg.content = msg.content.replace(/https?:\/\/twitter\.com(?=\/.*?\/)/g, "https://fxtwitter.com");
+ msg.content = msg.content.replace(re, "https://fxtwitter.com");
},
start() {