Merge pull request #2 from voidf1sh/v1.0.2-dev
This commit is contained in:
commit
37c0436b51
4
.github/workflows/docker-image.yml
vendored
4
.github/workflows/docker-image.yml
vendored
@ -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
|
||||
|
@ -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 </tree:972648557796524032> message and a single </top trees:1051840665362894950> message that everyone uses. If everyone creates their own </tree:972648557796524032> and </top trees:1051840665362894950>, 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 </setup:1065407649363005561> in the channel(s) that contain your server's tree and leaderboard messages.\n2. Now simply run </compare:1065346941166297128> 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": {
|
||||
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "treeanalyzer",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Analyze Grow A Tree",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
@ -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.`);
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user