galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more
MIT License
464 stars 373 forks source link

bot cannot respond from container #771

Closed LilJohnDee closed 1 year ago

LilJohnDee commented 1 year ago

Describe the bug the bot will run flawlessly with npm run dev while using public lavalink. when i try to containerize the bot, none of the commands work. have tried lavalink with the container and public server but i figure this is not the issue.

To Reproduce completed steps to bring up the bot with npm - launched and operational ran $ sudo docker compose --env-file docker.env up -d -build containers build without error, bot launches but will not respond to any commands.

  1. Use any command
  2. provide any argument

Expected behavior expected the bot to run as it did with npm run

Screenshots n/a

Desktop (please complete the following information):

Additional context i really didnt want to open an issue but it seems i require some assistance as i am not well versed in docker as of yet. i have an older version of master-bot running in a container on my unraid server and was hoping to do the same with the new discord api version... Sorry to bother!!!

Bacon-Fixation commented 1 year ago

Howdy my friend,

it is not a bother, happy to help. even with the docker compose method of running the bot, there should still be a Master-Bot/logs folder created,

highly likely to see something similar to the message below for the last few log entries

01-19-2023 11:58:43 error: Client Listener TRPCClientError: Guild not found
01-19-2023 11:58:43 error: Client Listener TRPCClientError: Guild not found

Guild not found can happen when the bot containers were build/created with the bot still in the discord server, kick the bot from the discord server, then start the docker container, then re-invite the bot to the discord server, should be good to go.

I hope this helps, if you have a different error in the log file, post it here, and we can work on getting ya running

Much Love -Bacon

LilJohnDee commented 1 year ago

sorry it took so long... i accidentally wrecked the VM i had it running on and had to rebuild the environment after rescuing my files but that was exactly it!! Thank you so very much!! i have tested a couple of times now and it is exactly as you stated, error and all :)

I am going to try to push/pull the composite container over to my unraid server but i figured i would ask: Can the composite container now be moved to another location without having to drag the accompanying containers along with it?

ps: apologies for marking the issue as a bug, i know it was 100% operator error but i thought i had to choose a tag >.<

Bacon-Fixation commented 1 year ago

No worries, That's a good question, I'm not sure. I personally haven't used unraid or tried to move a composite container.

Let me know how it goes, I'm curious. Best of luck my friend

Much Love -Bacon

LilJohnDee commented 1 year ago

after a bit of reading and testing, it seems i will need to mess with the Dockerfile to have all 4 images built within the same container.... if i manage to figure it out would you like me to post the file here?

feel free to close this issue as the bot is operational as intended :) Thanks again for the help!!!

Bacon-Fixation commented 1 year ago

my apologise my friend for the delayed response, more than welcome to post a PR for review.

Master-Bot/Dockerfile has a couple of lines for standalone use.

i do believe it is possible to run the docker compose on unraid through the gui, or third possible option is to create a container for docker compose to run it.

Some more info can be found on the docker compose pr #742

I hope this helps

Much Love -Bacon

Bacon-Fixation commented 1 year ago

Howdy @LilJohnDee, Gonna go ahead close this issue, if you have any other issues or suggestion, please feel free to post them.

Much Love -Bacon

LilJohnDee commented 1 year ago

hopefully this wont reopen the issue.... but i was just wondering if there is any documentation on the dashboard?

i feel like i am missing something somewhere but im not seeing anything obvious to me :(

Thanks again for all your help; and of course the amazing bot!!

Bacon-Fixation commented 1 year ago

Howdy, there is a small section Here on redirects

Go to the OAuth2 tab in the developer portal, copy the Client ID to DISCORD_CLIENT_ID and generate a secret to place in DISCORD_CLIENT_SECRET. Also, set the following URLs under 'Redirects':

double check that you have the redirect urls in your Discord Dev Portal to the example above, in most cases http://localhost:3000/api/auth/callback/discord should work (private bot use)

image

If you want to use a public IP address or a domain, make sure the port is open (public bot use)

I hope this helps. If you are still having issues, open a new issue, and we'll try to get ya running

Much Love -Bacon

LilJohnDee commented 1 year ago

Thanks, i have seen this bit and messed around with it a bit and think im getting closer.... but will play with it some more and open a ticket if i cant figure it out :) Thanks again for all your help!