Send a message if no X/Twitter links are provided
Some checks are pending
CI / CI (push) Waiting to run
Some checks are pending
CI / CI (push) Waiting to run
This commit is contained in:
parent
1f48a896a5
commit
62fbb445e2
1 changed files with 4 additions and 3 deletions
|
|
@ -3,8 +3,9 @@ module.exports = {
|
||||||
name: 'x',
|
name: 'x',
|
||||||
description: 'Replaces X/Twitter links with fxtwitter and deletes the original message',
|
description: 'Replaces X/Twitter links with fxtwitter and deletes the original message',
|
||||||
execute({message, args}) {
|
execute({message, args}) {
|
||||||
if(args.length < 0) {
|
const noUrlErr = "You need to provide an X or twitter link to use this command."
|
||||||
message.channel.send("TODO: NO_X_LINK_ERR");
|
if(args.length < 1) {
|
||||||
|
message.channel.send(noUrlErr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let replacedLink = "";
|
let replacedLink = "";
|
||||||
|
|
@ -13,7 +14,7 @@ module.exports = {
|
||||||
replacedLink = args[0].replace(regex, "fxtwitter.com");
|
replacedLink = args[0].replace(regex, "fxtwitter.com");
|
||||||
}
|
}
|
||||||
if(replacedLink.length === 0){
|
if(replacedLink.length === 0){
|
||||||
message.channel.send("You need to provide an X or twitter link to use this command.");
|
message.channel.send(noUrlErr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
message.channel.send(replacedLink);
|
message.channel.send(replacedLink);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue