#Help with jsdocs @param

20 messages · Page 1 of 1 (latest)

coarse lotus
#

`// @ts-check
const { GuildMember } = require('discord.js');
/**

  • @param {GuildMember} test
    */`
    Im using jsdocs but test is still not found, any suggestions?
frosty mulch
#

what

#

you dont have to install it

#

because js has its own jsdoc thing

#

Let me show your an example

#

This how i used it

#
import MyClient from '../../../structures/client.js';
import { Message } from 'discord.js';
import CommandHandler from '../../../structures/handlers/command.js';

  /**
     * @param {MyClient} client
     * @param {Message} message
     * @param {String[]} args
     */
  async execute(client, message, args) {
    message.channel.send('Ping command works');
  }
coarse lotus
#

Does it work with "require"?

frosty mulch
#

of course

#

just change the import to require

coarse lotus
#

Ahhh, moment, maybe its because I'm using it inside "module.exports" ?

frosty mulch
#
- import MyClient from '../../../structures/client.js';
+ const { MyClient } = require('...');
coarse lotus
#

module.exports = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Replies with Pong!'), async execute(interaction) { await interaction.reply('Pong!'); }, };
im trying to make "interaction" available

frosty mulch
#

so it should be

coarse lotus
#

`const { SlashCommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder, Collection, EmbedBuilder, GuildMember } = require('discord.js');
let AnswerCollection = new Collection();
/**

  • @param {GuildMember} test
    */
    test`
    this ist still not working mhhhh
frosty mulch
#
const { CommandChatInputInteraction } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!'),
    
    /*
     * @param {CommandChatInputInteraction} interaction
     */
    async execute(interaction) {
        await interaction.reply('Pong!');
    },
};
coarse lotus
#

Ahhh, it needs to be before the parameter?

frosty mulch
#

yes

#

Cool