DRSchlaubi / mikbot

A modular framework for building Discord bots in Kotlin using Kordex and Kord
35 stars 11 forks source link

excited with code 1 #218

Closed QuantumRage100 closed 2 years ago

QuantumRage100 commented 2 years ago

I'm having a bit of trouble getting this bot to run, I have docker and lavalink installed, I have created changed my .env and created the docker-compose.yml as well when I try to run the bot it just ends up exciting with code 1 would you be able to point and laughing at me before telling me what I'm doing wrong?

Microsoft Windows [Version 10.0.19044.1889] (c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd C:\Music-Bot-2

C:\Music-Bot-2>docker-compose up -d [+] Running 16/16

[+] Running 2/2docker-compose up

DRSchlaubi commented 2 years ago

Something went wrong while initializing Kord, make sure the bot token you entered is valid.{"message": "401: Unauthorized", "code": 0}

QuantumRage100 commented 2 years ago

I'm 90% sure I have a valid bot token, I was planning on replacing my current self hosted music bot with this one, and I used the same token, after you mentioned something might be wrong with the token I created a new separate bot account and generated a new token. it still gave me the same error, am I putting the token in incorrectly by any chance? I will take a screen shot as an example (not with my active token of course) image

NyCodeGHG commented 2 years ago

you did not remove the <> characters from the token

QuantumRage100 commented 2 years ago

you know it's funny, because I tried removing the < > around everything but that didn't work previously, I'm just realizing now that when I create a docker image it uses the .env file but after that it will ignore changes, so every time I make an edit in the .env file I need to remake or update the docket image, anyway thanks it seems to be pulling the bot token now

I am having a different issue now which may be related to my JDK version, I saw in one of the older documents you were recommending jdk 13 but that one seems a little outdated (it isn't even listed on the jdk main download page anymore) which JDK version do you recommend? I'm currently running 17

and here is the error I am seeing in the console

music-bot-bot-1 | 2022-09-11 02:10:40.472 [DefaultDispatcher-worker-18] ERROR [Koin] - Instance creation error : could not create instance for [Singleton:'com.kotlindiscord.kord.extensions.sentry.SentryAdapter',binds:com.kotlindiscord.kord.extensions.sentry.SentryAdapter]: java.lang.IllegalArgumentException: DSN is required. Use empty string to disable SDK.

I will attach the entire console log output as a text document as well if this information is not enough koin - instance creation error.txt

NyCodeGHG commented 2 years ago

When you're using docker you don't need a jdk. The JDK we're using is included in the docker image. I'm not sure about the sentry thing. Maybe @DRSchlaubi knows how to fix this

DRSchlaubi commented 2 years ago

Set ENVIRONMENT=DEVELOPMENT to disable sentry

QuantumRage100 commented 2 years ago

awesome yep that seemed to work, alright I'm starting to wrap my head around how complex this bot is, I must say this would not be an easy bot to set up for most users but, wow it seems powerful, so I have the main uh "framework" I guess you would call it running just fine, bot shows up in the server as running etc, but I don't have any commands yet, I want to set this up as a music bot, I have the image_color_service running and listening on http://0.0.0.0:8080, I think this is working properly I installed happi.dev using npm I happi-dev-sdk (to the same folder as the music bot, I'm not sure if I should put it anywhere else and I tried to run it with npm run but, I am not 100% sure if this is a service in need to run, or if the bot will just call for it when it needs, I'm hoping just having it here in the correct location is enough but I'm not 100% sure

the bottom of my .env now looks like this image

when I run this command I get this response C:\Music-Bot>docker-compose exec mongo mongo -u bot -p bot OCI runtime exec failed: exec failed: unable to start container process: exec: "mongo": executable file not found in $PATH: unknown still the plugins appear to be loading correctly, I hope >~<

when I run the bot I am getting this error message I will add the entire console log as a text file again incase it is important

bot_1 | 2022-09-11 15:18:00.812 [DefaultDispatcher-worker-1] ERROR dev.kord.gateway.DefaultGateway - Gateway closed: 4014 Disallowed intent(s). 4014 Disallowed intent(s).txt

also thankyou very much for the help you have given me, I wouldn't be able to figure out every little step of this on my own, I like to think I'm fairly with it when it comes to technology but some of this stuff is very new to me

DRSchlaubi commented 2 years ago

The music plugin requires the Guild Messages intent to be enabled in the Discord Developer Dashboard

DRSchlaubi commented 2 years ago

also try docker-compose exec mongo mongosh -u bot -p bot****

QuantumRage100 commented 2 years ago

yep the guild members intent seemed to fixed the crashing issue again ty :)

that command seems to be working better, it is telling me authentication failed now when I run it

C:\Music-Bot>docker-compose exec mongo mongosh -u bot -p bot**** Current Mongosh Log ID: 631e8e345b3f4416ad3c3123 Connecting to: mongodb://@127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.4 MongoServerError: Authentication failed.

I can now /play in the server, and the bot will give me options to play something but I get told that the application did not respond on discord, I can see things happening in the console however then I type /play "something"

the application did not respond.txt