We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
whenever a slash command option is optional and not provided, it returns this error:
attempt to index local 'args' (a nil value)
this is my code:
local slashCommand = {} local option = {} slashCommand = tools.slashCommand("amount", "see amount of flops you/user have/has said") option = tools.user("member", "the member") option = option:setRequired(false) slashCommand = slashCommand:addOption(option) client:createGlobalApplicationCommand(slashCommand)
client:on("slashCommand", function(interaction, command, args) if command.name == "amount" then if db[ tostring( args.member.id ) ] then interaction:reply( args.member.name .. " has said flop " .. tostring( db[ tostring( args.member.id ) ] ) .. " times" ) else interaction:reply( args.member.name .. " hasn't said flop" ) end end end)
any help?
The text was updated successfully, but these errors were encountered:
Are you using lit or GitHub version?
Sorry, something went wrong.
github version
I didn't support global commands by default. Someone made a commit, but I can't tell if this is related.
Is "member" a required parameter?
no
No branches or pull requests
whenever a slash command option is optional and not provided, it returns this error:
this is my code:
any help?
The text was updated successfully, but these errors were encountered: