NamVr / DiscordBot-Template

A boilerplate / template for discord.js v14 bots with 100% coverage of Discord API, command handler, error handler based on https://discordjs.guide/
https://djs.docs.namanvrati.me/
Apache License 2.0
322 stars 75 forks source link

[HELP] Unwanted Slash Interactions Visible #7

Closed FallOsprey closed 3 years ago

FallOsprey commented 3 years ago

When I run the bot and look at the slash commands through Discord, I see is has commands like /admin embed, /admin say, /info ping, and /info userinfo. I want to get rid of these but I can't find them anywhere in the bots files. 2021-10-17 (2)

NamVr commented 3 years ago

Hey, are you sure you can't find them in interactions/slash folder?

FallOsprey commented 3 years ago

Yes

FallOsprey commented 3 years ago

The only thing I see is help.js

NamVr commented 3 years ago

Probably inside a category in that folder, right? Have you tried restarting the bot to re-update the commands?

FallOsprey commented 3 years ago

2021-10-17 (4) Just that

NamVr commented 3 years ago
  1. Try running the commands and show me the output,
  2. Try restarting bot to update slash commands,
  3. Make sure you are using guild-based interaction type to update your work instantly.
FallOsprey commented 3 years ago

2021-10-17 (7) All command interactions fail (except help). I have restarted the bot multiple times. I don't understand number 3

I can send you the code if you would like to take a peak

NamVr commented 3 years ago

2021-10-17 (7) All command interactions fail (except help). I have restarted the bot multiple times. I don't understand number 3

This indeed means that the commands are actually not available. You should try restarting your discord client (discord app), do Ctrl + R also try restarting your network connection. I don't see this issue from the coding side.

NamVr commented 3 years ago

Please don't hesitate to reply if that didn't fixed the issue. As of now, I consider this is solved and hence closing the issue.

FallOsprey commented 3 years ago

Still having issues

NamVr commented 3 years ago

Please explain in brief.

FallOsprey commented 3 years ago

I restarted Discord, my connection, the bot, and even removed it from the server and joined it back.

Same thing, those slash commands still showing.

NamVr commented 3 years ago

I believe this is caching then, did you made the commands global? or it is guild based?

FallOsprey commented 3 years ago

Guild I think

NamVr commented 3 years ago

You will need to confirm it for me.

NamVr commented 3 years ago

You can also try to forcefully delete the slash command using ApplicationCommand methods.

FallOsprey commented 3 years ago

Routes.applicationGuildCommands(client_id, test_guild_id),

NamVr commented 3 years ago

Yeah, looks cool for guild. I will assume you have done your config file properly. So yeah, you can use the ApplicationCommand methods as mentioned in docs, to forcefully delete it.

FallOsprey commented 3 years ago

How would I do that tho

NamVr commented 3 years ago

Make a slash command manager? Or just raw scripts using a eval command? Anything that hits up your head will make it possible.

FallOsprey commented 3 years ago

I dont know how to do that

NamVr commented 3 years ago

Eval Javascript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval Delete Application Command https://discord.js.org/#/docs/main/stable/class/ApplicationCommand?scrollTo=delete Find The Specific Command https://discord.js.org/#/docs/main/stable/class/ApplicationCommandManager?scrollTo=cache

Do not click spoiler without trying!

Spoiler :hankey: Open this only when you have read the docs, tried making your code or tried everything else you could do. Clicking this means you give up.
I Give Up! Eval Command (Look MDN Docs for more info) > ```js > eval(args.join(' ')) > ``` Use Discord Based Command to execute scripts: > [prefix]eval const cmd = message.guild.commands.cache.find(c => c.name == "command-name"); > cmd.delete()
FallOsprey commented 3 years ago

Still doesn't work since the commands don't exist but still show up.

NamVr commented 3 years ago

Hit me up on discord rn allroundernaman#3915 and I'll test it in your server. (The last thing I can offer)

FallOsprey commented 3 years ago

Your F requests are off, [link hidden].