mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
fix stats not working in DMs
This commit is contained in:
parent
e89e53ef58
commit
7d0680d5aa
2 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ class Stats extends BaseCommand {
|
||||||
{
|
{
|
||||||
name: client.customEmojis.status.online + " " + interaction.translate("general/stats:ONLINE_TITLE"),
|
name: client.customEmojis.status.online + " " + interaction.translate("general/stats:ONLINE_TITLE"),
|
||||||
value: interaction.translate("general/stats:ONLINE_CONTENT", {
|
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),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@ module.exports = {
|
||||||
* @param {String} locale Language
|
* @param {String} locale Language
|
||||||
* @returns {String} Time
|
* @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 languageData = client.languages.find(language => language.name === locale);
|
||||||
const m = moment(time).locale(languageData.moment);
|
const m = moment(time).locale(languageData.moment);
|
||||||
return type ? m.toNow(noPrefix) : m.fromNow(noPrefix);
|
return type ? m.toNow(noPrefix) : m.fromNow(noPrefix);
|
||||||
|
|
Loading…
Reference in a new issue