Change uptime to show hours if it exceeds an hour
This commit is contained in:
parent
118e27ea5c
commit
8093998cda
1 changed files with 2 additions and 1 deletions
|
@ -4,7 +4,8 @@ module.exports = function ({presenceText, presenceType, client}) {
|
|||
const {globalPrefix} = require ('../data/config.json')
|
||||
let guildCount = getGuildCount(client)
|
||||
let uptime = parseMS(client.uptime);
|
||||
let uptimeInMinutes = uptime.days * 24 * 60 + uptime.hours * 60 + uptime.minutes;
|
||||
let uptimeSingularOrPlural = uptime.hours > 1 || uptime.minutes > 1 ? "s" : "";
|
||||
let uptimeInMinutes = uptime.hours >= 1 || uptime.days >= 1 ? uptime.days * 24 + uptime.hours + ` hour${uptimeSingularOrPlural}`: uptime.minutes + ` minute${uptimeSingularOrPlural}`;
|
||||
let regex = [/\${guilds}/g,/\${prefix}/g,/\${uptime}/g];
|
||||
let replaceValue = [guildCount, globalPrefix, uptimeInMinutes];
|
||||
for(let i = 0; i < regex.length; i++){
|
||||
|
|
Loading…
Add table
Reference in a new issue