Fix fxTwitter regex (#100)
* Fixes so that wont affect other things like likes * Fixes #97 Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
parent
2cb6c23347
commit
d73a6e2c89
1 changed files with 3 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue