diff --git a/src/Scripts/network/displayStarterHubs.ts b/src/Scripts/network/displayStarterHubs.ts index 9a483111..830a875f 100644 --- a/src/Scripts/network/displayStarterHubs.ts +++ b/src/Scripts/network/displayStarterHubs.ts @@ -1,64 +1,64 @@ -import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, ComponentType, EmbedBuilder } from 'discord.js'; -import { getDb } from '../../Utils/functions/utils'; -import { stripIndents } from 'common-tags'; -import logger from '../../Utils/logger'; - -export = { - async execute(interaction: ChatInputCommandInteraction) { - const db = getDb(); - try { - const allHubs = await db.hubs.findMany({ where: { official: true } }); - - const embed = new EmbedBuilder() - .setTitle('Pick your Starter Hub') - .setDescription(stripIndents` - A hub is a public network that servers can join. Messages will only be recieved by other members of the hub. - - Below are some **starter hubs**. Please select one you wish to be a part of: - `) - .setFooter({ text: 'Tip: You can join other community hubs using /hub browse!' }) - .setColor('#0099ff'); - - const rows: ActionRowBuilder[] = []; - - for (let i = 0; i < allHubs.length; i++) { - const hub = allHubs[i]; - if (!hub.official) continue; - - rows.push(new ActionRowBuilder().addComponents( - new ButtonBuilder() - .setCustomId(hub.id) - .setLabel(hub.name) - .setStyle(ButtonStyle.Primary), - )); - - embed.addFields({ - name: hub.name, - value: hub.description, - inline: i % 3 === 0 ? false : true, - }); - } - - const reply = await interaction.editReply({ - embeds: [embed], - components: rows, - }); - - const selection = await reply.awaitMessageComponent({ - componentType: ComponentType.Button, - filter: (i) => i.user.id === interaction.user.id, - time: 30_000, - }).catch(() => null); - - if (selection) { - await selection.deferUpdate(); - return { id: selection.customId }; - } - } - catch (err) { - logger.error(err); - interaction.editReply('An error occurred while retrieving the hubs. Please try again later.'); - } - return false; - }, -}; +// import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, ComponentType, EmbedBuilder } from 'discord.js'; +// import { getDb } from '../../Utils/functions/utils'; +// import { stripIndents } from 'common-tags'; +// import logger from '../../Utils/logger'; +// +// export = { +// async execute(interaction: ChatInputCommandInteraction) { +// const db = getDb(); +// try { +// const allHubs = await db.hubs.findMany({ where: { official: true } }); +// +// const embed = new EmbedBuilder() +// .setTitle('Pick your Starter Hub') +// .setDescription(stripIndents` +// A hub is a public network that servers can join. Messages will only be recieved by other members of the hub. +// +// Below are some **starter hubs**. Please select one you wish to be a part of: +// `) +// .setFooter({ text: 'Tip: You can join other community hubs using /hub browse!' }) +// .setColor('#0099ff'); +// +// const rows: ActionRowBuilder[] = []; +// +// for (let i = 0; i < allHubs.length; i++) { +// const hub = allHubs[i]; +// if (!hub.official) continue; +// +// rows.push(new ActionRowBuilder().addComponents( +// new ButtonBuilder() +// .setCustomId(hub.id) +// .setLabel(hub.name) +// .setStyle(ButtonStyle.Primary), +// )); +// +// embed.addFields({ +// name: hub.name, +// value: hub.description, +// inline: i % 3 === 0 ? false : true, +// }); +// } +// +// const reply = await interaction.editReply({ +// embeds: [embed], +// components: rows, +// }); +// +// const selection = await reply.awaitMessageComponent({ +// componentType: ComponentType.Button, +// filter: (i) => i.user.id === interaction.user.id, +// time: 30_000, +// }).catch(() => null); +// +// if (selection) { +// await selection.deferUpdate(); +// return { id: selection.customId }; +// } +// } +// catch (err) { +// logger.error(err); +// interaction.editReply('An error occurred while retrieving the hubs. Please try again later.'); +// } +// return false; +// }, +// };