jack3898 / discord-youtube-bot-2

A powerful Discord YouTube Bot.
0 stars 0 forks source link

Bot not responding to commands #5

Closed naftis closed 2 years ago

naftis commented 2 years ago

Hi, this is most likely an user error but might be useful for someone else too. Basically I followed the README, and have the bot running as such:

image

I then invited the bot to my Discord server with these permissions: https://discordapi.com/permissions.html#2150695936

The commands aren't showing up when I'm writing /, and nothing is also happening when I say /play. What should I do to get it working?

jack3898 commented 2 years ago

Hi @naftis have you put your bot's ID in the .env file you created? 🙂 It's needed so that the slash commands can be properly registered.

Jack

jack3898 commented 2 years ago

I should also mention, and coming to think of it this may be the reason why, Discord slash commands can take up to 1 hour to register when this bot is in production mode!

image The image above is a screenshot from the Discord.js guide on registering slash commands at https://discordjs.guide/interactions/registering-slash-commands.html#global-commands

naftis commented 2 years ago

Okay, it seems to be some kind of user error but I'm not sure what. I created a new Discord server, and it works perfectly there. Nice!

But the original server I was adding it to still doesn't work. It's probably some kind of permission problem, but I'll try and see if I can find what the problem is and reply here after. Unless you have some kind of idea? 🤔

jack3898 commented 2 years ago

Ahhh I'm feeling like that could be a permission thing. Have you tried the same OAuth URL with the old server as you have with the new one? 🤔

naftis commented 2 years ago

I joined both of the servers with the link this created discordapi.com/permissions.html#2150695936 . So I think yeah.

jack3898 commented 2 years ago

And I'm guessing you have permission as a user on the faulty server to use application commands? 🤔 If it's disabled for @everyone and your highest role (except admin) you won't be able to see slash commands.

Screenshot_20220116-124729.png

naftis commented 2 years ago

Yep, we actually have it enabled for @everyone now that I look at it. Also when typing / it shows atleast the giphy + ban + kick stuff so I should have permissions to use the slash commands.

I also tried to kick the bot and add it back with the same link, but nothing :s

I'm guessing it's just some stupid simple stuff but just can't figure out what is it :D

jack3898 commented 2 years ago

You're not in development mode are you? I know you started in production but if you're in development it'll only work for a specific server!

naftis commented 2 years ago

Alright, figured out the problem (not sure why it worked for the other server though):

http://discordapi.com/permissions.html#2150695936 this gives a link as such https://discord.com/oauth2/authorize?client_id=client_id&scope=bot&permissions=2150695936

but I had to add a "applications.commands" scope so that the link looks like https://discord.com/oauth2/authorize?client_id=client_id&scope=bot%20applications.commands&permissions=2150695936

Now the bot works great. Thanks for your help :)

jack3898 commented 2 years ago

Ahhh I see, glad you got it sorted!

In your original question you had it enabled (I think) so I never brought it up! 😂