diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5f27b9d..1c73922 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -19,8 +19,8 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build the Docker image - run: docker build . --file Dockerfile --tag v0idf1sh/treeanalyzer + run: docker build . --file Dockerfile --tag v0idf1sh/silvanus - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub - run: docker push v0idf1sh/treeanalyzer + run: docker push v0idf1sh/silvanus diff --git a/data/strings.json b/data/strings.json index fd8f889..8a637c8 100644 --- a/data/strings.json +++ b/data/strings.json @@ -2,10 +2,10 @@ "help": { "info": "This bot will analyze your tree (from the Grow A Tree Bot by Limbo Labs) and compare its growth to other trees displayed on the leaderboard.\n\nThis bot assumes that there is a single message and a single message that everyone uses. If everyone creates their own and , the reference messages will have to be updated every time, or old data will be displayed.", "setup": "To begin analyzing your Tree, first you must set up the reference messages.\n\n1. Run in the channel(s) that contain your server's tree and leaderboard messages.\n2. Now simply run where you want your analysis to be visible.", - "permissions": "At a minimum, Grow A Tree Analyzer requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. If Analyzer is given permission to `Manage Messages`, the bot will delete the `.settree` and `.setranks` messages to reduce spam." + "permissions": "At a minimum, Silvanus requires permissions to `Send Messages` and `Send Messages in Threads` if applicable. If Analyzer is given permission to `Manage Messages`, the bot will delete the `.settree` and `.setranks` messages to reduce spam." }, "embeds": { - "footer": "Grow A Tree Analyzer is not affiliated with Grow A Tree or Limbo Labs", + "footer": "Silvanus is not affiliated with Grow A Tree or Limbo Labs", "color": "0x55FF55" }, "emoji": { diff --git a/modules/functions.js b/modules/functions.js index 04f32ee..7a6ca2b 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -150,12 +150,13 @@ const functions = { let difference = parseFloat(e.height).toFixed(1) - treeHeight; const absDifference = parseFloat(Math.abs(difference)).toFixed(1); if (difference > 0) { - replyString += `${absDifference}ft shorter than rank #${e.rank}\n`; + replyString += `#${e.rank} - ${absDifference}ft shorter `; } else if (difference < 0) { - replyString += `${absDifference}ft taller than rank #${e.rank}\n`; + replyString += `#${e.rank} - ${absDifference}ft taller `; } else if (difference == 0) { - replyString += `Same height as rank #${e.rank}\n`; + replyString += `#${e.rank} - Same height `; } + replyString += `[${functions.getWaterTime(e.height)}m]\n`; }); return 'Here\'s how your tree compares: \n' + replyString; } else { @@ -236,6 +237,9 @@ const functions = { } else { return "Your guild hasn't been set up yet."; } + }, + getWaterTime(size) { + return Math.floor((Math.pow(size * 0.07 + 5, 1.1) / 60)); } }; diff --git a/package.json b/package.json index 95da8f7..84e6880 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "treeanalyzer", - "version": "1.0.1", + "version": "1.0.2", "description": "Analyze Grow A Tree", "main": "main.js", "scripts": { diff --git a/slash-commands/watertime.js b/slash-commands/watertime.js index c6a4510..4338176 100644 --- a/slash-commands/watertime.js +++ b/slash-commands/watertime.js @@ -13,7 +13,6 @@ module.exports = { async execute(interaction) { await interaction.deferReply(); const treeHeight = interaction.options.getString('height'); - const waterTime = Math.floor(Math.floor(Math.pow(treeHeight * 0.07 + 5, 1.1)) / 60); - await interaction.editReply(`A tree that is ${treeHeight}ft tall will have a watering time of ${waterTime} minutes.`); + await interaction.editReply(`A tree that is ${treeHeight}ft tall will have a watering time of ${fn.getWaterTime(treeHeight)} minutes.`); }, }; \ No newline at end of file