You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently (or possibly forever now) the args command has been returning an array value with undefined as the first array value. Upon further delving into your code (SlashCommands.js) at line 65 is where it seems to pass the arguments through as strings, this is returning undefined as it cannot convert an object into a string. My code is a bit long but ill post a small snippet that should be able to replicate the problem
module.exports={name: "initials",slash: true,options:
[{name: 'initials',description: 'provide your first and last name',type: Discord.Constants.ApplicationCommandOptionTypes.SUB_COMMAND,required: false,options: [{name: 'firstname',description: 'Your first name',type: Discord.Constants.ApplicationCommandOptionTypes.STRING,required: true,options: null},{name: 'lastname',description: 'Your last name',type: Discord.Constants.ApplicationCommandOptionTypes.STRING,required: false,options: null}],}],callback: async({ interaction, args, client })=>{firstname=args[0];lastname=args[1];interaction.reply(`Your firstname is ${firstname} and your lastname is ${lastname}`)}}
Running this command returns "Your firstname is undefined and your lastname is undefined"
The text was updated successfully, but these errors were encountered:
mcdaddytalk
added a commit
to mcdaddytalk/WOKCommands
that referenced
this issue
May 6, 2022
Recently (or possibly forever now) the args command has been returning an array value with undefined as the first array value. Upon further delving into your code (SlashCommands.js) at line 65 is where it seems to pass the arguments through as strings, this is returning undefined as it cannot convert an object into a string. My code is a bit long but ill post a small snippet that should be able to replicate the problem
Running this command returns "Your firstname is undefined and your lastname is undefined"
The text was updated successfully, but these errors were encountered: