Skip to content

Commit

Permalink
Merge pull request #15 from cloudmaker97/change-time-display
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudmaker97 authored Dec 8, 2024
2 parents 9fa2db3 + 885461f commit bcc9851
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 0 additions & 2 deletions source/Services/DiscordEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
33 changes: 1 addition & 32 deletions source/Services/ServerStatusFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -187,7 +156,7 @@ export default class ServerStatusFeed {
if(minutesString.length === 1) {
minutesString = `0${minutesString}`;
}
return `${hoursString}:${minutesString} (${this.getServerMonth()})`;
return `${hoursString}:${minutesString}`;
}

/**
Expand Down

0 comments on commit bcc9851

Please sign in to comment.