diff options
author | Berlin <39058370+somerandomcloud@users.noreply.github.com> | 2022-10-14 18:13:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 18:13:13 +0200 |
commit | d73a6e2c8979ba0536452bfb19586556fe032aca (patch) | |
tree | e300bff2c01b15a271592163654290401675df11 /src | |
parent | 2cb6c23347e3305ee04367c2bf2d6e6603a09839 (diff) | |
download | Vencord-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')
-rw-r--r-- | src/plugins/fxTwitter.ts | 4 |
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() { |