mirror of
https://github.com/cloudmaker97/FS25-Discord-Bot.git
synced 2025-12-06 00:18:34 +00:00
Merge pull request #15 from cloudmaker97/change-time-display
This commit is contained in:
commit
bcc98514e6
3 changed files with 2 additions and 35 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ls25-discord-bot",
|
"name": "ls25-discord-bot",
|
||||||
"version": "0.1.6",
|
"version": "0.1.7",
|
||||||
"description": "A simple discord bot for farming simulator 25",
|
"description": "A simple discord bot for farming simulator 25",
|
||||||
"main": "source/Main.ts",
|
"main": "source/Main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,6 @@ export default class DiscordEmbed {
|
||||||
let embed = new EmbedBuilder();
|
let embed = new EmbedBuilder();
|
||||||
let config = this.appConfiguration;
|
let config = this.appConfiguration;
|
||||||
|
|
||||||
serverStats.getServerMonth();
|
|
||||||
|
|
||||||
embed.setTitle(config.translation.discordEmbed.title);
|
embed.setTitle(config.translation.discordEmbed.title);
|
||||||
if (!serverStats.isOnline()) {
|
if (!serverStats.isOnline()) {
|
||||||
embed.setColor(0xCA0000);
|
embed.setColor(0xCA0000);
|
||||||
|
|
|
||||||
|
|
@ -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 the server time in the format HH:MM
|
||||||
* @returns {string} 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) {
|
if(minutesString.length === 1) {
|
||||||
minutesString = `0${minutesString}`;
|
minutesString = `0${minutesString}`;
|
||||||
}
|
}
|
||||||
return `${hoursString}:${minutesString} (${this.getServerMonth()})`;
|
return `${hoursString}:${minutesString}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue