Merge pull request #15 from cloudmaker97/change-time-display

This commit is contained in:
Dennis Heinrich 2024-12-08 02:32:00 +01:00 committed by GitHub
commit bcc98514e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 35 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ls25-discord-bot",
"version": "0.1.6",
"version": "0.1.7",
"description": "A simple discord bot for farming simulator 25",
"main": "source/Main.ts",
"scripts": {

View file

@ -100,8 +100,6 @@ export default class DiscordEmbed {
let embed = new EmbedBuilder();
let config = this.appConfiguration;
serverStats.getServerMonth();
embed.setTitle(config.translation.discordEmbed.title);
if (!serverStats.isOnline()) {
embed.setColor(0xCA0000);

View file

@ -137,37 +137,6 @@ export default class ServerStatusFeed {
});
}
/**
* Returns the server month as a string
* @returns {string} The server month as a string
*/
public getServerMonth(): string {
let config: IConfiguration = Configuration.getConfiguration();
let dayTime = this.getServerStats()?.Server.dayTime;
if (dayTime === undefined) {
return "Error";
}
let month = dayTime / (60 * 60 * 1000 * 24);
month = month % 1;
month = month * 12;
month = Math.floor(month);
let months = [
config.translation.common.monthJanuary,
config.translation.common.monthFebruary,
config.translation.common.monthMarch,
config.translation.common.monthApril,
config.translation.common.monthMay,
config.translation.common.monthJune,
config.translation.common.monthJuly,
config.translation.common.monthAugust,
config.translation.common.monthSeptember,
config.translation.common.monthOctober,
config.translation.common.monthNovember,
config.translation.common.monthDecember
]
return months[month-1];
}
/**
* Returns the server time in the format HH:MM
* @returns {string} The server time in the format HH:MM
@ -187,7 +156,7 @@ export default class ServerStatusFeed {
if(minutesString.length === 1) {
minutesString = `0${minutesString}`;
}
return `${hoursString}:${minutesString} (${this.getServerMonth()})`;
return `${hoursString}:${minutesString}`;
}
/**