src/interactions/menus/getInfo.ts (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import {
ApplicationCommandType,
type Client,
ContextMenuCommandBuilder,
type UserContextMenuCommandInteraction,
} from "discord.js";
import config from "@/config";
import { getUserInfoFromDiscord } from "@/utils/userInfo";
const commandData = new ContextMenuCommandBuilder()
.setName("get account")
.setType(ApplicationCommandType.User);
async function execute(
_client: Client,
interaction: UserContextMenuCommandInteraction,
) {
const result = await getUserInfoFromDiscord(interaction.targetId);
if ("error" in result) {
return interaction.reply({
content: `❌ ${result.error}`,
flags: ["Ephemeral"],
});
}
await interaction.reply({
embeds: [result.embed],
components: result.components,
});
}
export default {
enabled: config.data.bloxlink?.token && config.data.roblox?.apiKey,
data: commandData,
execute,
};
|