From 17dd134934c0200624f5b2546bbba4bd91ac8c19 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 4 Feb 2026 04:16:48 +0100 Subject: [PATCH 1/9] Don't set presence when it hasn't changed --- util/setPresence.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/setPresence.js b/util/setPresence.js index f5c750e..942ae49 100644 --- a/util/setPresence.js +++ b/util/setPresence.js @@ -38,7 +38,11 @@ module.exports = function ({presenceText, presenceType, client}) { } try { - client.user.setPresence({ activities: [{ name: presenceText, type: presenceType }]}); + const lastPresenceObject = client.settings.get("lastPresenceObject") + if(lastPresenceObject.presenceType !== presenceType && lastPresenceObject.presenceText !== presenceText){ + client.user.setPresence({ activities: [{ name: presenceText, type: presenceType }]}); + client.settings.set(lastPresenceObject, {presenceType, presenceText}) + } }catch(e){ console.error(`${convertDateToISOString(new Date)}\n${e}`); } From 94d1b0f2974da9f9e2192d2ebe200ecc2362dc93 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 26 Feb 2026 10:52:40 +0100 Subject: [PATCH 2/9] Make the say command admin only --- commands/misc/say.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/misc/say.js b/commands/misc/say.js index e8ca4e6..2995f6a 100644 --- a/commands/misc/say.js +++ b/commands/misc/say.js @@ -1,6 +1,7 @@ module.exports = { name: 'say', description: 'Repeats arguments', + admin: true, execute({message, args}) { if(args.length == 0) From 1f48a896a5d975376d6faa3db5e26e84603bd0da Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 26 Feb 2026 10:58:18 +0100 Subject: [PATCH 3/9] Add X command that replaces X/Twitter links with fxtwitter --- commands/misc/x.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 commands/misc/x.js diff --git a/commands/misc/x.js b/commands/misc/x.js new file mode 100644 index 0000000..802cf75 --- /dev/null +++ b/commands/misc/x.js @@ -0,0 +1,27 @@ + +module.exports = { + name: 'x', + description: 'Replaces X/Twitter links with fxtwitter and deletes the original message', + execute({message, args}) { + if(args.length < 0) { + message.channel.send("TODO: NO_X_LINK_ERR"); + 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){ + message.channel.send("You need to provide an X or twitter link to use this command."); + return; + } + message.channel.send(replacedLink); + try{ + message.delete() + }catch(err){ + console.error(`${this.name}: An error happened while trying to delete the original message.`) + console.error(err); + } + } +}; \ No newline at end of file From 62fbb445e2867cc2cb1e1799879ce01ecadfb6fa Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 26 Feb 2026 18:30:02 +0100 Subject: [PATCH 4/9] Send a message if no X/Twitter links are provided --- commands/misc/x.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/misc/x.js b/commands/misc/x.js index 802cf75..1d35bd4 100644 --- a/commands/misc/x.js +++ b/commands/misc/x.js @@ -3,8 +3,9 @@ module.exports = { name: 'x', description: 'Replaces X/Twitter links with fxtwitter and deletes the original message', execute({message, args}) { - if(args.length < 0) { - message.channel.send("TODO: NO_X_LINK_ERR"); + 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 = ""; @@ -13,7 +14,7 @@ module.exports = { replacedLink = args[0].replace(regex, "fxtwitter.com"); } 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; } message.channel.send(replacedLink); From 62b8ebb4cf1f104bbebe9934bce5f8826fd69277 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 27 Feb 2026 19:23:36 +0100 Subject: [PATCH 5/9] Use lookbehind to improve x command regex --- commands/misc/x.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/misc/x.js b/commands/misc/x.js index 1d35bd4..bf8e1c7 100644 --- a/commands/misc/x.js +++ b/commands/misc/x.js @@ -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"); } From 9796e9245ae75b40e71d1f5003696c5ce5b9612a Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 27 Feb 2026 19:24:01 +0100 Subject: [PATCH 6/9] Don't send an unchanged link in x command --- commands/misc/x.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/misc/x.js b/commands/misc/x.js index bf8e1c7..2e7283b 100644 --- a/commands/misc/x.js +++ b/commands/misc/x.js @@ -12,6 +12,9 @@ module.exports = { const regex = /(?<=\/)(x|twitter)\.com/g if(args[0].startsWith("https://") || args[0].startsWith("http://")){ replacedLink = args[0].replace(regex, "fxtwitter.com"); + }else { + message.channel.send(noUrlErr); + return; } if(replacedLink.length === 0){ message.channel.send(noUrlErr); From 7791fa5654d3c1705d5a5f5e86f70d5b28465ca4 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 27 Feb 2026 19:25:40 +0100 Subject: [PATCH 7/9] Improve error message when message.delete() fails --- commands/misc/x.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/misc/x.js b/commands/misc/x.js index 2e7283b..2a9b515 100644 --- a/commands/misc/x.js +++ b/commands/misc/x.js @@ -24,7 +24,7 @@ module.exports = { try{ message.delete() }catch(err){ - console.error(`${this.name}: An error happened while trying to delete the original message.`) + console.error(`${this.name}: An error occurred while trying to delete the original message.`) console.error(err); } } From d7b8e706b867abc50a1edbe1ce454860965fb8b9 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 27 Feb 2026 19:28:54 +0100 Subject: [PATCH 8/9] Add ig link replacing command --- commands/misc/ig.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/misc/ig.js diff --git a/commands/misc/ig.js b/commands/misc/ig.js new file mode 100644 index 0000000..af45466 --- /dev/null +++ b/commands/misc/ig.js @@ -0,0 +1,31 @@ + +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"); + }else { + message.channel.send(noUrlErr); + return; + } + if(replacedLink.length === 0){ + 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); + } + } +}; \ No newline at end of file From bc497c7dea5aa12042f0250899c77310b62ffb3d Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 27 Feb 2026 19:55:37 +0100 Subject: [PATCH 9/9] Fix sending links if they didn't get changed --- commands/misc/ig.js | 5 +---- commands/misc/x.js | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/commands/misc/ig.js b/commands/misc/ig.js index af45466..21268b7 100644 --- a/commands/misc/ig.js +++ b/commands/misc/ig.js @@ -12,11 +12,8 @@ module.exports = { const regex = /(?<=\/)(instagram)\.com/g if(args[0].startsWith("https://") || args[0].startsWith("http://")){ replacedLink = args[0].replace(regex, "kkinstagram.com"); - }else { - message.channel.send(noUrlErr); - return; } - if(replacedLink.length === 0){ + if(replacedLink.length === 0 || args[0] === replacedLink){ message.channel.send(noUrlErr); return; } diff --git a/commands/misc/x.js b/commands/misc/x.js index 2a9b515..87b6a26 100644 --- a/commands/misc/x.js +++ b/commands/misc/x.js @@ -12,11 +12,8 @@ module.exports = { const regex = /(?<=\/)(x|twitter)\.com/g if(args[0].startsWith("https://") || args[0].startsWith("http://")){ replacedLink = args[0].replace(regex, "fxtwitter.com"); - }else { - message.channel.send(noUrlErr); - return; } - if(replacedLink.length === 0){ + if(replacedLink.length === 0 || args[0] === replacedLink){ message.channel.send(noUrlErr); return; }