Don't send an unchanged link in x command
This commit is contained in:
parent
62b8ebb4cf
commit
9796e9245a
1 changed files with 3 additions and 0 deletions
|
|
@ -12,6 +12,9 @@ module.exports = {
|
||||||
const regex = /(?<=\/)(x|twitter)\.com/g
|
const regex = /(?<=\/)(x|twitter)\.com/g
|
||||||
if(args[0].startsWith("https://") || args[0].startsWith("http://")){
|
if(args[0].startsWith("https://") || args[0].startsWith("http://")){
|
||||||
replacedLink = args[0].replace(regex, "fxtwitter.com");
|
replacedLink = args[0].replace(regex, "fxtwitter.com");
|
||||||
|
}else {
|
||||||
|
message.channel.send(noUrlErr);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if(replacedLink.length === 0){
|
if(replacedLink.length === 0){
|
||||||
message.channel.send(noUrlErr);
|
message.channel.send(noUrlErr);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue