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:
parent
7b069ad429
commit
bf1a7985aa
4 changed files with 19 additions and 18 deletions
11
util/setPresence.js
Normal file
11
util/setPresence.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const getGuildCount = require("./getGuildCount")
|
||||
|
||||
module.exports = function ({presenceText, presenceType, client}) {
|
||||
const {globalPrefix} = require ('../data/config.json')
|
||||
let guildCount = getGuildCount(client)
|
||||
let regex = /<guilds>/g
|
||||
presenceText = presenceText.replace(regex, guildCount)
|
||||
regex = /<prefix>/g
|
||||
presenceText = presenceText.replace(regex, globalPrefix)
|
||||
client.user.setActivity(presenceText, { type: presenceType });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue