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}) {
|
||||
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)
|
||||
let regex = [/<guilds>/g,/<prefix>/g];
|
||||
let replaceValue = [guildCount, globalPrefix];
|
||||
for(let i = 0; i < regex.length; i++){
|
||||
presenceText = presenceText.replace(regex[i], replaceValue[i]);
|
||||
}
|
||||
client.user.setActivity(presenceText, { type: presenceType });
|
||||
}
|
Loading…
Add table
Reference in a new issue