From 5382b3ea5913fac7980fe23c8092d79eb539002f Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 25 Mar 2024 02:14:08 +0100 Subject: [PATCH] proper JSDoc typing in examples --- commands/examples/login.example.js | 2 ++ commands/examples/ping.example.js | 3 ++- commands/examples/role.example.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/commands/examples/login.example.js b/commands/examples/login.example.js index cf37c63..8565e60 100644 --- a/commands/examples/login.example.js +++ b/commands/examples/login.example.js @@ -9,9 +9,11 @@ import { export const data = new SlashCommandBuilder() .setName('login') .setDescription('Opens a login pop-up.'); +/** @param {ModalSubmitInteraction} interaction */ export async function modalSubmit(interaction) { await interaction.reply({ content: 'Successfully submitted Form!', ephemeral: true }); } +/** @param {ChatInputCommandInteraction} interaction */ export async function execute(interaction) { const modal = new ModalBuilder().setCustomId('login-modal').setTitle('Login Form'); diff --git a/commands/examples/ping.example.js b/commands/examples/ping.example.js index 42bb665..ea8aece 100644 --- a/commands/examples/ping.example.js +++ b/commands/examples/ping.example.js @@ -1,6 +1,7 @@ -import { SlashCommandBuilder } from 'discord.js'; +import { ChatInputCommandInteraction, SlashCommandBuilder } from 'discord.js'; export const data = new SlashCommandBuilder().setName('ping').setDescription('Replies with Pong!'); +/** @param {ChatInputCommandInteraction} interaction */ export async function execute(interaction) { await interaction.reply({ content: 'Pong!', ephemeral: true }); } diff --git a/commands/examples/role.example.js b/commands/examples/role.example.js index 50cd61e..fe9c8f9 100644 --- a/commands/examples/role.example.js +++ b/commands/examples/role.example.js @@ -1,4 +1,5 @@ import { + ChatInputCommandInteraction, ActionRowBuilder, ComponentType, RoleSelectMenuBuilder, @@ -9,6 +10,7 @@ export const data = new SlashCommandBuilder() .setName('role') .setDMPermission(false) .setDescription('Provides a role selector.'); +/** @param {ChatInputCommandInteraction} interaction */ export async function execute(interaction) { const roles = await interaction.guild.roles.fetch(); const choices = roles.filter((r) => r.name.startsWith('test')).map((r) => r.id);