This commit is contained in:
Christopher Cookman 2025-09-15 10:38:33 -06:00
parent 9526c3790b
commit 7eff1364be
3 changed files with 95 additions and 44 deletions

View file

@ -30,8 +30,24 @@ const execute = async (interaction) => {
// Proceed with creation // Proceed with creation
await interaction.reply({ ephemeral: true, content: "Getting things ready..." }); await interaction.reply({ ephemeral: true, content: "Getting things ready..." });
await interaction.user.send({ content: `Creating product: \`${productName}\`` }); await interaction.user.send({ content: `Creating product: \`${productName}\`` });
await interaction.user.send({ content: "Please provide a description for the product. Say `cancel` to exit." }); const finalMsg = await interaction.user.send({ content: "Please provide a description for the product. Say `cancel` to exit." });
interaction.editReply({ephemeral: true, content: "Check your DMs!"}); await interaction.editReply({
ephemeral: true,
content: "Check your DMs!",
components: [
{
type: 1, // ActionRow
components: [
{
type: 2, // Button
style: 5, // Link button
label: "Go there!",
url: finalMsg.url
}
]
}
]
});
global.productCreationData[interaction.user.id] = { global.productCreationData[interaction.user.id] = {
name: productName, name: productName,
step: 1, step: 1,

View file

@ -16,7 +16,8 @@ const execute = async (interaction) => {
} }
// Proceed with settings menu // Proceed with settings menu
await interaction.reply({ ephemeral: true, content: "Getting things ready..." }); await interaction.reply({ ephemeral: true, content: "Getting things ready..." });
await interaction.user.send({ embeds: [{ await interaction.user.send({
embeds: [{
title: 'Welcome to Hub Settings!', title: 'Welcome to Hub Settings!',
description: 'Below are your current hub settings.', description: 'Below are your current hub settings.',
color: 0x00AE86, color: 0x00AE86,
@ -33,7 +34,7 @@ const execute = async (interaction) => {
{ name: "Log Channel ID", value: hubResult[0].logChannel ? hubResult[0].logChannel.toString() : "Not Set" }, { name: "Log Channel ID", value: hubResult[0].logChannel ? hubResult[0].logChannel.toString() : "Not Set" },
{ name: "Secret Key", value: `||\`${hubResult[0].secretKey}\`||` } { name: "Secret Key", value: `||\`${hubResult[0].secretKey}\`||` }
] ]
},{ }, {
description: `Options`, description: `Options`,
color: 0x00AE86, color: 0x00AE86,
fields: [ fields: [
@ -47,9 +48,26 @@ const execute = async (interaction) => {
{ name: "8. Set Log Channel", value: "Set or change the log channel for this hub." }, { name: "8. Set Log Channel", value: "Set or change the log channel for this hub." },
{ name: "99. Delete hub and all products", value: "***__WARNING: THIS IS DANGEROUS__***" } { name: "99. Delete hub and all products", value: "***__WARNING: THIS IS DANGEROUS__***" }
] ]
}] }); }]
await interaction.user.send({ content: "Say an option number, or `cancel` to exit!" }); });
interaction.editReply({ephemeral: true, content: "Check your DMs!"}); const finalMsg = await interaction.user.send({ content: "Say an option number, or `cancel` to exit!" });
await interaction.editReply({
ephemeral: true,
content: "Check your DMs!",
components: [
{
type: 1, // ActionRow
components: [
{
type: 2, // Button
style: 5, // Link button
label: "Go there!",
url: finalMsg.url
}
]
}
]
});
global.hubSettingsHandlers[interaction.user.id] = { global.hubSettingsHandlers[interaction.user.id] = {
step: 1, step: 1,
hub: hubResult[0].id hub: hubResult[0].id

View file

@ -20,35 +20,52 @@ const execute = async (interaction) => {
// Proceed with creation // Proceed with creation
await interaction.reply({ ephemeral: true, content: "Getting things ready..." }); await interaction.reply({ ephemeral: true, content: "Getting things ready..." });
await interaction.user.send({ content: `Updating product: \`${product.name}\`` }); await interaction.user.send({ content: `Updating product: \`${product.name}\`` });
let finalMsg;
switch (interaction.options.getString("field")) { switch (interaction.options.getString("field")) {
case "name": case "name":
await interaction.user.send({ content: "Please provide a new name for the product. Say `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Please provide a new name for the product. Say `cancel` to exit." });
break; break;
case "description": case "description":
await interaction.user.send({ content: "Please provide a new description for the product. Say `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Please provide a new description for the product. Say `cancel` to exit." });
break; break;
case "devProductId": case "devProductId":
await interaction.user.send({ content: "Please provide a new developer product ID for the product. Say `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Please provide a new developer product ID for the product. Say `cancel` to exit." });
break; break;
case "imageId": case "imageId":
await interaction.user.send({ content: "Please provide a new image ID for the product. Say `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Please provide a new image ID for the product. Say `cancel` to exit." });
break; break;
case "file": case "file":
await interaction.user.send({ content: "Please provide a new file for the product. Say `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Please provide a new file for the product. Say `cancel` to exit." });
break; break;
case "stock": case "stock":
await interaction.user.send({ content: "Please provide a new stock quantity for the product. Say `cancel` to exit. Set `-1` to disable." }); finalMsg = await interaction.user.send({ content: "Please provide a new stock quantity for the product. Say `cancel` to exit. Set `-1` to disable." });
break; break;
case "category": case "category":
await interaction.user.send({ content: "Please provide a new category for the product. Say `cancel` to exit. Set to `~none` to remove." }); finalMsg = await interaction.user.send({ content: "Please provide a new category for the product. Say `cancel` to exit. Set to `~none` to remove." });
break; break;
case "delete": case "delete":
await interaction.user.send({ content: "Are you sure you want to delete this product? This action is irreversible, and all buyees will lose access to the file forever! Type `confirm` to delete, or `cancel` to exit." }); finalMsg = await interaction.user.send({ content: "Are you sure you want to delete this product? This action is irreversible, and all buyees will lose access to the file forever! Type `confirm` to delete, or `cancel` to exit." });
break; break;
default: default:
return interaction.editReply({ content: "Invalid field provided.", ephemeral: true }); return interaction.editReply({ content: "Invalid field provided.", ephemeral: true });
} }
interaction.editReply({ ephemeral: true, content: "Check your DMs!" }); await interaction.editReply({
ephemeral: true,
content: "Check your DMs!",
components: [
{
type: 1, // ActionRow
components: [
{
type: 2, // Button
style: 5, // Link button
label: "Go there!",
url: finalMsg.url
}
]
}
]
});
global.productUpdateData[interaction.user.id] = { global.productUpdateData[interaction.user.id] = {
id: product.id, id: product.id,
type: interaction.options.getString("field") type: interaction.options.getString("field")