Use lookbehind to improve x command regex
This commit is contained in:
parent
62fbb445e2
commit
62b8ebb4cf
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
let replacedLink = "";
|
||||
const regex = /(x|twitter)\.com/g
|
||||
const regex = /(?<=\/)(x|twitter)\.com/g
|
||||
if(args[0].startsWith("https://") || args[0].startsWith("http://")){
|
||||
replacedLink = args[0].replace(regex, "fxtwitter.com");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue