Compare commits

..
Author SHA1 Message Date
17dd134934
Don't set presence when it hasn't changed
All checks were successful
CI / CI (push) Successful in 24s
2026-02-04 04:16:48 +01:00
4 changed files with 5 additions and 58 deletions

View file

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

View file

@ -1,28 +0,0 @@
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);
}
}
};

View file

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