-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
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
Starting the bot #48
Comments
You must assign your BOT's application ID which you can find in https://discord.com/developers/applications Then, you have to define it in .env (DISCORD_CLIENT_ID = "yourId" |
what format is the .env file supposed to be... right now i have it as a txt file |
.env is already a format you just have to insert all your BOT's credentials into it. I believe there is already one .env.example right here if you fork the project, you just have to remove .example out of .env.example and then do what I said earlier |
im pretty new to windows and i dont know how to make it just have .env... i copied it over and originally it was an example file... |
oh wait |
You can do it 2 ways. First, if you are using a text editor like VS Code, you can create a new .env file directly or just rename .env.example to .env. Second, you can navigate directly to the project directory and right click New>Text Document(.txt) and rename that New Text.txt (all of them) to just .env |
Is your bot already in a server? If it is, you have to add scope commands (oAuth2) bot and application.commands when you invite the BOT to your server |
my bot is not in a server as of yet should it be? |
yes, I think you should invite your bot into a server to debug and test if it works. Slash commands are only working if the bot is already in a server |
uhhh now that i think of it theres no invite button is there... |
how exactly do i get the bot in? |
navigate to discord developer portal here : https://discord.com/developers/applications and then click on your bot application that you have created. From there, you will see OAuth2(it is an url generator for your bot's invitation). Open it and tick 2 boxes in Scopes which are bot and applications.commands and on the Bot Permissions you can add anything you want for you bot. Once you're done, click on copy on the link right below Scopes options and then it will redirect you to discord. You can find more about it here #2 |
ok i did it and still getting the same error... sorry for all the trouble |
it's okay. that would be helpful if you can send me a screenshot of the error |
have you tried using npm instead of yarn? if you installed the dependencies using yarn it should have no problem running yarn start but i would suggest you retry using npm to see if the error still occurs |
both have the same error unfortunately |
then it must have something to do with index.js where SlashCreate is not defined properly. if you can, send me a screenshot of your index.js right where you define your slashcreate class |
https://drive.google.com/file/d/1wGFiAyMPwNz__Mx9cyU0DLFi3eeYbxo7/view?usp=sharing |
is there any dependancies not listed in the instructions that i have to have? |
yeah, it should have no problem tho. i did a fresh reinstall using yarn but failed to generate the same error as yours. |
no, just running either yarn install or npm install should install all the dependencies that are registered in package.json. |
looking at teh firsst issue thing theres the same errors and it was talking about discord.js and Node |
oh yeah! i overlooked that issue lol! it has something to do with discordjs version and node.js version. make sure you have the latest discord.js version and node.js version which is 16.9.1 as i recalled |
how do i check if i have it and the versions |
you can check your current node version using node -v |
my node version is 14.17.6 |
oh you are running the lts version of node.js. this repo currently only supports the newer version of discordjs(v13) which is using node.js version 16.x |
https://nodejs.org/en/ and download the 169.1 latest features and install it again. it will automatically update your current node version |
aye it started now but its permanently generating docs... |
reinvite the bot with the same scope commands and you should be fine! |
the bot is visibly online but non functional... |
oh, have you assigned your GUILD_ID in your .env file? if you want your bot to be in multiple servers then delete DISCORD_GUILD_ID in .env and it should sync all the slash commands in each servers. if you just want to run it in a single server then you have to assign your guild(server)id in .env file |
is there a way to restart the bot to update the file? |
press Ctrl + C in the terminal and then type node . again |
the commands still arnt working |
it is because of the made changes. try reinviting the bot again to see if the commands arent still working |
still no luck |
does it matter if i start it with yarn or npm |
uh is the guild id the server id? |
and thanks for all the help |
yes it is! to copy the server id you need to enable developer mode in discord setting |
don't mention it. happy to help! |
ok after trying with a server id... i got a whole lotta green text |
does the green text looks like this in #22 ? |
yes actually |
those are the scope commands that i added |
it should already work. if you already added scope commands & also defined GUILD_ID in .env file it should sync slash-commands in your server |
maybe try to restart the bot again? |
... now i get the application id must be defined... |
oh gosh xD! how could this happened again.. you made sure you filled in all the credentials in .env file, right? |
aaaaaa the commands started registering again... the music isnt playing tho... it joined but no sound |
have you already installed ffmpeg? if yes, #12 said that you have to install opusscript because of a missing dependency |
i just have to install ffmpeg with git r? |
better to install ffmpeg-static instead by typing yarn add ffmpeg-static or npm install --save ffmpeg-static (choose your own preference whether to use npm or yarn) |
AAA ITS WORKING TYSM |
happy to help!! |
Hi i keep getting an error 'an application id must be assigned' can someone tell me what im doing wrong
The text was updated successfully, but these errors were encountered: