silvanus/slash-commands/setup.js
Skylar Grant 5ef905449d
Dev-v1.1.4 (#9)
* Add 24h growth indicator

* Fix float math

* Fix some bugs

* Trim decimals

* Add 24 hour observed growth

* Add beginning height option

* Changed startup message to ping me

* Add a ping reminder and setup command for it

* Setup automatic water reminders

* Improved workflows

* New water readiness system

* Documentation Time

* Fix slash command link

* Fix linebreaks

* Readability improvements

* Forgot to allow checking in prod

* Switch to ephemeral reply

* Restructuring and new help messages

* Not meant to be uploaded

* Documentation update

* Changing the way reminders are deleted

* Tweak timings

* Adjust readiness detection system

* moar tweekz

* fix reminders

* Updates to water reminders
2023-01-31 22:51:10 -05:00

37 lines
1.3 KiB
JavaScript

const { SlashCommandBuilder } = require('discord.js');
const fn = require('../modules/functions.js');
const strings = require('../data/strings.json');
const dbfn = require('../modules/dbfn.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Attempt automatic configuration of the bot.')
.addChannelOption(o =>
o.setName('treechannel')
.setDescription('What channel is your tree in?')
.setRequired(true))
.addChannelOption(o =>
o.setName('leaderboardchannel')
.setDescription('If your leaderboard isn\'t in the same channel, where is it?')
.setRequired(false)),
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
/**/
let guildInfo = {
"guildId": interaction.guildId,
"treeName": "",
"treeHeight": 0,
"treeMessageId": "",
"treeChannelId": `${interaction.options.getChannel('treechannel').id }`,
"leaderboardMessageId": "",
"leaderboardChannelId": `${interaction.options.getChannel('leaderboardchannel').id || interaction.options.getChannel('treechannel').id }`,
"reminderMessage": "",
"reminderChannelId": "",
"remindedStatus": 0,
"reminderOptIn": 0,
};
const findMessagesResponse = await fn.messages.find(interaction, guildInfo);
interaction.editReply(findMessagesResponse.status);
},
};