Use a for loop instead of being an idiot
This commit is contained in:
parent
b8b272c099
commit
607ae7d853
1 changed files with 5 additions and 4 deletions
|
@ -3,9 +3,10 @@ const getGuildCount = require("./getGuildCount")
|
||||||
module.exports = function ({presenceText, presenceType, client}) {
|
module.exports = function ({presenceText, presenceType, client}) {
|
||||||
const {globalPrefix} = require ('../data/config.json')
|
const {globalPrefix} = require ('../data/config.json')
|
||||||
let guildCount = getGuildCount(client)
|
let guildCount = getGuildCount(client)
|
||||||
let regex = /<guilds>/g
|
let regex = [/<guilds>/g,/<prefix>/g];
|
||||||
presenceText = presenceText.replace(regex, guildCount)
|
let replaceValue = [guildCount, globalPrefix];
|
||||||
regex = /<prefix>/g
|
for(let i = 0; i < regex.length; i++){
|
||||||
presenceText = presenceText.replace(regex, globalPrefix)
|
presenceText = presenceText.replace(regex[i], replaceValue[i]);
|
||||||
|
}
|
||||||
client.user.setActivity(presenceText, { type: presenceType });
|
client.user.setActivity(presenceText, { type: presenceType });
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue