diff --git a/commands/General/stats.js b/commands/General/stats.js index 1d1ef79c..26dc3f38 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -72,7 +72,7 @@ class Stats extends BaseCommand { { name: client.customEmojis.status.online + " " + interaction.translate("general/stats:ONLINE_TITLE"), value: interaction.translate("general/stats:ONLINE_CONTENT", { - time: client.functions.convertTime(client, Date.now() + client.uptime, true, true, data.guildData.language), + time: client.functions.convertTime(client, Date.now() + client.uptime, true, true, data?.guildData?.language), }), }, { diff --git a/helpers/functions.js b/helpers/functions.js index 2596af9a..43d9ce92 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -109,7 +109,7 @@ module.exports = { * @param {String} locale Language * @returns {String} Time */ - convertTime(client, time, type = false, noPrefix = false, locale = this.defaultLanguage) { + convertTime(client, time, type = false, noPrefix = false, locale = client.defaultLanguage) { const languageData = client.languages.find(language => language.name === locale); const m = moment(time).locale(languageData.moment); return type ? m.toNow(noPrefix) : m.fromNow(noPrefix);