Compare commits

...
Author SHA1 Message Date
bc497c7dea
Fix sending links if they didn't get changed
Some checks failed
CI / CI (push) Has been cancelled
2026-02-27 19:55:37 +01:00
d7b8e706b8
Add ig link replacing command
Some checks are pending
CI / CI (push) Waiting to run
2026-02-27 19:28:54 +01:00
7791fa5654
Improve error message when message.delete() fails
Some checks are pending
CI / CI (push) Waiting to run
2026-02-27 19:25:40 +01:00
9796e9245a
Don't send an unchanged link in x command 2026-02-27 19:24:01 +01:00
62b8ebb4cf
Use lookbehind to improve x command regex 2026-02-27 19:23:36 +01:00
62fbb445e2
Send a message if no X/Twitter links are provided
Some checks are pending
CI / CI (push) Waiting to run
2026-02-26 18:30:02 +01:00
1f48a896a5
Add X command that replaces X/Twitter links with fxtwitter
Some checks failed
CI / CI (push) Has been cancelled
2026-02-26 10:58:18 +01:00
94d1b0f297
Make the say command admin only
Some checks are pending
CI / CI (push) Waiting to run
2026-02-26 10:52:40 +01:00
3 changed files with 57 additions and 0 deletions

28
commands/misc/ig.js Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
name: 'ig',
description: 'Replaces Instagram links with kkinstagram and deletes the original message',
execute({message, args}) {
const noUrlErr = "You need to provide an Instagram link to use this command."
if(args.length < 1) {
message.channel.send(noUrlErr);
return;
}
let replacedLink = "";
const regex = /(?<=\/)(instagram)\.com/g
if(args[0].startsWith("https://") || args[0].startsWith("http://")){
replacedLink = args[0].replace(regex, "kkinstagram.com");
}
if(replacedLink.length === 0 || args[0] === replacedLink){
message.channel.send(noUrlErr);
return;
}
message.channel.send(replacedLink);
try{
message.delete()
}catch(err){
console.error(`${this.name}: An error occurred while trying to delete the original message.`)
console.error(err);
}
}
};

View file

@ -1,6 +1,7 @@
module.exports = { module.exports = {
name: 'say', name: 'say',
description: 'Repeats arguments', description: 'Repeats arguments',
admin: true,
execute({message, args}) { execute({message, args}) {
if(args.length == 0) if(args.length == 0)

28
commands/misc/x.js Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
name: 'x',
description: 'Replaces X/Twitter links with fxtwitter and deletes the original message',
execute({message, args}) {
const noUrlErr = "You need to provide an X or twitter link to use this command."
if(args.length < 1) {
message.channel.send(noUrlErr);
return;
}
let replacedLink = "";
const regex = /(?<=\/)(x|twitter)\.com/g
if(args[0].startsWith("https://") || args[0].startsWith("http://")){
replacedLink = args[0].replace(regex, "fxtwitter.com");
}
if(replacedLink.length === 0 || args[0] === replacedLink){
message.channel.send(noUrlErr);
return;
}
message.channel.send(replacedLink);
try{
message.delete()
}catch(err){
console.error(`${this.name}: An error occurred while trying to delete the original message.`)
console.error(err);
}
}
};