Merge pull request #3 from voidf1sh:v1.0.3-dev
Add active growth indicator
This commit is contained in:
commit
48ed66cf0a
@ -148,13 +148,18 @@ const functions = {
|
||||
let replyString = 'Current Tree Height: ' + treeHeight + 'ft\n\n';
|
||||
guildInfo[interaction.guildId].rankings.forEach(e => {
|
||||
let difference = parseFloat(e.height).toFixed(1) - treeHeight;
|
||||
let decimal = (e.height % 1).toFixed(1);
|
||||
let growthIndicator = "";
|
||||
if (decimal > 0) {
|
||||
growthIndicator += "[+]";
|
||||
}
|
||||
const absDifference = parseFloat(Math.abs(difference)).toFixed(1);
|
||||
if (difference > 0) {
|
||||
replyString += `#${e.rank} - ${absDifference}ft shorter `;
|
||||
replyString += `#${e.rank} - ${absDifference}ft${growthIndicator} shorter `;
|
||||
} else if (difference < 0) {
|
||||
replyString += `#${e.rank} - ${absDifference}ft taller `;
|
||||
replyString += `#${e.rank} - ${absDifference}ft${growthIndicator} taller `;
|
||||
} else if (difference == 0) {
|
||||
replyString += `#${e.rank} - Same height `;
|
||||
replyString += `#${e.rank} - Same height${growthIndicator} `;
|
||||
}
|
||||
replyString += `[${functions.getWaterTime(e.height)}m]\n`;
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "treeanalyzer",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "Analyze Grow A Tree",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user