LinkCloudDev/server/commands/utility/joinlinkcloud.js

42 lines
2.5 KiB
JavaScript
Raw Normal View History

2024-08-02 22:55:55 +00:00
import {
SlashCommandBuilder,
ActionRowBuilder,
ButtonStyle,
ModalBuilder,
TextInputBuilder,
ButtonBuilder,
} from "discord.js";
import { getLSFromGuildId, getLSModel } from "../../Utility/lsModel.js";
import { event } from "../../Utility/eventHandler.js";
import { numRows, runPrepQuery } from "../../Utility/db.js";
import uuid4 from "uuid4";
import { addUser } from "../../Utility/userModel.js";
export default {
data: new SlashCommandBuilder().setName("lcjoin").setDescription("Configure and download the LinkCloud addon."),
async execute(interaction) {
const userString = interaction.user.id;
const user = await addUser(userString);
const button = new ButtonBuilder()
.setLabel("LinkCloud for FFXI Windower Retail")
.setURL(`http://linkcloud.drunken.games:3000/addons/windower/retail/${userString}`)
.setStyle(ButtonStyle.Link);
const button2 = new ButtonBuilder()
.setLabel("LinkCloud for FFXI Ashita Retail")
.setURL(`http://linkcloud.drunken.games:3000/addons/ashita/retail/${userString}`)
.setStyle(ButtonStyle.Link);
if (user) {
await interaction.reply({
content: `# LinkCloud Setup\n### Installing LinkCloud for FFXI Retail (PlayOnline)\nIf you are using FFXI Windower 4, use the "[LinkCloud for FFXI Windower Retail](http://linkcloud.drunken.games:3000/addons/windower/retail/${userString})" button to download the addon\nIf you are using Ashita, use the "[LinkCloud for FFXI Ashita Retail](http://linkcloud.drunken.games:3000/addons/ashita/retail/${userString})" button to download the addon\n- Extract the addon to your \`C:\\Program Files (x86)\\Windower\\addons\` folder.\n- Load the addon with the \`//lua l linkcloud\` command\n- To load this addon on startup, add \`lua load linkcloud\` to your \`C:\\Program Files (x86)\\Windower\\scripts\\init.txt\` file.\n\n### Installing LinkCloud for Horizon XI\nWe are currently working with Horizon XI to have our addon added to the list.\n\n### Manual Installation\nIf you have installed the addon manually, you will need to set the auth token for your client. This is not currently supported in the Alpha testing phase.\n\n# Support the project\nPlease join the project discord for continued support and updates, but mostly just to let Smokey know you care ;)\nhttps://discord.gg/n5VYHSQbhA`,
ephemeral: true,
components: [
new ActionRowBuilder().addComponents(button),
new ActionRowBuilder().addComponents(button2),
],
});
} else {
await interaction.reply({ content: "Failed to create user.", ephemeral: true });
}
},
};