#Help with jsdocs @param
20 messages · Page 1 of 1 (latest)
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');
}
Does it work with "require"?
of course
just change the import to require
Ahhh, moment, maybe its because I'm using it inside "module.exports" ?
- import MyClient from '../../../structures/client.js';
+ const { MyClient } = require('...');
module.exports = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Replies with Pong!'), async execute(interaction) { await interaction.reply('Pong!'); }, };
im trying to make "interaction" available
well then you should put it above the async
so it should be
`const { SlashCommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandBuilder, Collection, EmbedBuilder, GuildMember } = require('discord.js');
let AnswerCollection = new Collection();
/**
- @param {GuildMember} test
*/
test`
this ist still not working mhhhh
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!');
},
};
Ahhh, it needs to be before the parameter?
yes
Cool