15 lines
740 B
JavaScript
15 lines
740 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 robloxId = interaction.options.getNumber("roblox-id");
|
|
const discordID = interaction.options.getUser("discord-id")?.id;
|
|
if (discordID) await pool.query("UPDATE users SET discordId = NULL WHERE discordId = ?", [discordID]);
|
|
if (robloxId) await pool.query("UPDATE users SET discordId = NULL WHERE robloxId = ?", [robloxId]);
|
|
return interaction.reply({ content: "Successfully unlinked accounts (If either were linked)", ephemeral: true });
|
|
}
|
|
|
|
const noop = () => { };
|
|
|
|
module.exports = { execute } |