Refactor presence stuff

* Create new function that sets presence which replaces with correct
  variables
* Probably some more shit I don't remember
This commit is contained in:
SileNce5k 2021-07-09 18:10:49 +02:00
parent 7b069ad429
commit bf1a7985aa
No known key found for this signature in database
GPG key ID: C507260E7F2583AD
4 changed files with 19 additions and 18 deletions

View file

@ -1,3 +1,5 @@
const setPresence = require("../util/setPresence");
module.exports = {
name: 'setpresence',
description: 'Set the presence for the bot',
@ -20,9 +22,8 @@ module.exports = {
}
const firstArg = args[0].length + 1;
let temp = args.join(" ");
let regex = /<prefix>/g
let presenceText = temp.slice(firstArg, temp.length)
client.user.setActivity(presenceText.replace(regex, globalPrefix), { type: presenceType });
setPresence({presenceText: presenceText,presenceType: presenceType, client: client, globalPrefix: globalPrefix});
savePresence(presenceType, presenceText);
message.channel.send("Updated presence.")
}