NotParcel/commands/hub.js

11 lines
555 B
JavaScript

const client = global.discord_client
const pool = global.db_pool;
const execute = async (interaction) => {
if (!interaction.guildId) return interaction.reply({ content: "This command can only be used in a server", ephemeral: true });
const [hub] = await pool.query('SELECT * FROM hubs WHERE discordGuild = ?', [interaction.guildId]);
if (hub.length === 0) return interaction.reply({ content: "This server is not a hub", ephemeral: true });
interaction.reply({ content: `You can access the hub [here!](${hub.hubUrl})`})
}
module.exports = { execute }