![]() ![]() You have successfully created a discord bot and hosted it. Now after some time, the bot should be online.Īnd if you test the bot, it should work pretty fast. Then select edit variables and add the TOKEN variable. After that, select the repository with the bot code and click on Create Project. Then select the Create from GitHub option. Create an account and open the dashboard. Now that we have created the bot, we need to host it. So, if you want to add more commands, you can add them to the commands object. npm install dotenvĪfter that, open the package.json file and add the following scripts. env file, we will be using the dotenv package. npm install discord.js # or pnpm install discord.js / yarn add discord.jsĪnd for getting the token from the. Install the library using the following command. We will be using the discord.js library to create the bot. Now that we have the bot token, we can create the bot. ![]() Yaay! You have added the bot to your server.īut, the bot is offline. Now scroll to the bottom of the page and copy the URL.Īfter that, open it in a new tab and select the server you want to add the bot to. Then, check on the bot checkbox and check Administrator on the bottom checkboxes list. Lastly, we should add the bot to a Discord server, to do this, we go to the Developer portal again and go to the Oauth2->Url Generator. Make sure to replace YOUR_TOKEN_HERE with your bot token.Īlso, scroll bottom and toggle all the permissions to true. env file in the project directory and add the following contents. Accept it and you will get the bot token. Now go to the bot section and click on add bot. Now, once you have created the application, the page will get redirected to the application page. Getting Startedįirst, we need to get the discord bot token. ![]() You will need some basic knowledge of JavaScript and Node.js to follow along with this guide. This guide will show you how to make a discord bot with JavaScript and host it for free. Discord bots are a great way to automate tasks and make your server more fun. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |