Send a message if no X/Twitter links are provided
Some checks are pending
CI / CI (push) Waiting to run

This commit is contained in:
SileNce5k 2026-02-26 18:30:02 +01:00
commit 62fbb445e2
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -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);