How to Make a Discord Bot WITHOUT Coding or Downloading Anything (2021)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
do you want to make your own discord bot but don't know how to code well if you watch this video until the end i'm going to teach you guys how to make a discord bot without coding step by step now before we get on with the video i wanted to ask you a question do you own a discord server if so leave the name of it down in the comment section below now all the time stamps for the things i show you how to do in today's video are going to be in the description section down below so feel free to pause the video and skip around to your liking now without further ado let's get into the video alright so in order to make our discord bot the first thing we have to understand is the library or packages that we might be using so today we're going to be using something called scratch for discord which is an online ide as well as a tool that you can install on your computer that allows you to create discord bots using this drag and drop block interface now the main thing you have to understand is that this bot right here this is not the actual code that it's behind the scenes scratch for discord is creating a javascript file based on which you can then download onto your computer or run in the cloud so in this tutorial i'm going to show you how you can create a discord bot with some cool features added to your server get started and even host it 24 7 for completely free alright so without further ado let's get started with the first step so the thing you're going to have to do is head down into the description below where i'll have this link for the scratch for discord netlify app this should take you to this webpage over here and if you start out with a blank page all you'll have to do is head over to the examples tab and select ping pong command the reason why we're doing this is so we can get a base layout that's really quick so the next thing we're going to do is we're going to connect to discord with a token so right now we have this placeholder holder over here but we first have to create our discord bot so head down into the description below and click on the second link that i'll have and this will take you to discord.dev or the developer portal over here in the top right corner select new application this will create the new application we're going to name it something and then we're going to press create this is going to create our application you can always rename this later so don't worry about it just yet again you can also change the profile picture of your application but in order to turn this into a discord bot which will reply to us and do all sorts of cool features we have to head over to the bot tab on the left side press add bot this will turn the account into a discord bot over here you have the username and profile picture of your bot as well as something called the token now the token is basically a piece that is required for every single user and every single bot on discord that specifies what type of or what what you are this is the unique identification for your bot or your user account so this is meant to be safe you should not be sharing this token with anybody regardless of who they might be you should only trust this with your closest developers as you know if somebody else gets hold of your token they can actually hack into your bot and do crazy stuff with it like if your bot is admin in a server they can even use your bot just to delete the entire server or uh raid and do bad things like that so you're always going to going to want to keep your token as safe as possible so as you can see over here i've pasted the token back into this block over here so what this is doing is it's going to log into discord using this token and now we have our first message event this is called a message event and essentially what it does is whenever a message is received in our discord server it's going to execute this code inside so what it's going to execute is if message content message content is a fancy of way of saying the text inside of a message if the text is equal to exclamation ping exactly then we're going to reply to that message saying pong okay so the next thing we have to do is add our bot into our server now that we have this basic code head back over to the developer portal head over to the oauth 2 section of your application press this bot check that and then over here give your bots some permissions i'd recommend not giving your bot the administrator permission the reason behind this is because the administrator permission gives the access to your bot to do anything in the server including delete roles delete channels uh band members and all that stuff so if your bot is very simple you just wanted to send some messages then all you're going to need is send messages and view channels maybe but let's say you want your bot to be more advanced you want it to be able to moderate you can give it kick members band members do whatever you want but in my case i'm specifically going to give it send messages and view channels which is accessible by the default role on my server so i actually don't even have to give it any permissions next we're going to go back over here copy our link and then we can paste it so we can actually close out of the developer portal now so i'm just going to paste it right over here as you can see this takes you to an authorization page this is going to ask you to add the bot to a server now the list over here that should show up is the servers that you have the manage server permission in so if you go over to your discord server you go over to the server settings you go over to the roles then over here you'll see a list of rules if we click on one of the rules you can see that under the permissions tab it will show various permissions so you have to either have the administrator permission or you have to have the managed server permission if you have either of those you'll have the ability to add bots into the discord server so that's just something you should know if you wanted to add it to a specific server you can only add it to a server where you have those permissions so i'm going to add it to riship jane's cafe which is my discord server so over here it's been authorized now the next thing we have to do is actually make the bot run because right now it's going to be offline so in order to do that it's quite simple first we're just going to name our bot i'm going to name it demo and as you can see it's been named the next thing we have to do is press this download button in the top right corner this is going to download the bot onto our computer or our home drive next over here you're going to use an unzipping tool i have winrar you can use 7-zip or the winzip extractor and essentially just extract it to a folder it doesn't really matter that much and as you can see this folder has been created so i'm going to delete these and this is our demo folder that has all the code that we just created right here so over here now we're going to go over to a site called rebel dot it so head over to oops replit on a side note the token that i'm using in this tutorial is going to be regenerated right after i finish filming so don't try to log into it it won't be any use so as you can see over here we're going to create our new rebel we're going to leave this on private as most of you don't have the paid version of replica that allows you to make it private so we're going to create this rupple as you can see it's loading up it's creating and booting our rebel so this rupple site what it allows you to do is create and run code so it's an online ide and then it has a terminal on the side of it that runs in a private server online so you can actually create bots by coding them here and then running them on the side console now what you can do over here is you're going to press upload folder you're going to select the folder that we just created and press upload now alternatively what you can do is you can also upload the file and then select all of these files to upload but i just found that this was easier okay so now you can see that we have this right over here so what i'm going to do is i'm going to take out our package.json file so you can do that just by dragging it out of this over here we're also going to take out the stop dot replit file this tells what we're going to do which is going to run node.js so the final thing we have to do is take out this bot.js file and then delete our index file so now this is set up it's pretty simple all we have to do is press the run button and it will install the packages so this is actually using a coding language called javascript and in javascript there are a variety of packages that you can actually use which is pretty cool so that we're going to use a package that's built into this thing as you can see it's creating this easy json database it's also using the discord js package so it might be using some of this information in order to run and create our bot so if this doesn't work i'd recommend just starting it up again hopefully that will work for you so as you can see something popped up it's saying d is not defined you can ignore this i think the site is still a beta version it's perhaps a work in progress so some of these errors yet haven't been resolved however your bot should now work if you are able to head into your discord server press the exclamation pin command it should respond to sing pong it's a great job you've created your first discord bot now this is where it gets really important so as i talked about earlier the token is supposed to be a very secretive piece of information that has to be held very carefully so you don't want to keep this public so what we're going to do is we're going to create a file called env what is that env env stands for environment so we can specify environment variables that are key to our replica so here i'm going to paste my token we're going to do token equals make sure this is in capital letters as it'll just make it easier later we're gonna go into bot.js over here where it says client login should be near the bottom uh you're gonna delete that whatever text or string that was there and replace it with process.env.token all right so just like that you've got your token privated alternatively if you have the paid version of replit you can make this a private repository just like i just did so that's up to you the next thing we're going to do is we're going to actually stop this code and we're going to host our bot 24 7. so in order to host our bot 24 7 there's a couple techniques one thing we can do is we can run it on our computer but i don't want to do that because i don't have my pc on during the night time and i want to keep my bot on 24 7. so over here in the top left corner you can press this replit is this rebel is always on now this is a paid version of repple if you don't have this however you can still do it for free and i'm going to show you exactly how to do that in this next part so what we're going to do is we're going to press add file and we're going to create a file called server.js now for the code that's supposed to go into this file you have to join my discord server which is going to be dsc.ggslash rjane and in the bots channel of my discord server head up to the pinned messages and as you can see if you press jump which will take you to this message this is the server.js code so just go ahead and copy this exactly the way it is and what this is doing let me explain this to you because if you're a new coder it's really important to understand what exactly you're doing and if you make the mistake of just copying other people's code or you know being what's known as a script kid um you might not learn the code and it might be a little bit difficult for you later on so what this code is doing is it's requiring something called express express allows us to create servers in our javascript language so we're going to define a variable called server which is equal to our express then on our server we're going to send your bot is alive so that's going to send a ping to our server and over here under function keep alive this is a very simple function what a function is is essentially it's going to have this keyword of keep alive and it's going to execute this code inside of the function whenever we call this function so what we're doing here is we're going to listen on this port called 3000 and we're going to console.log server is ready so this is going to tell us that our server is ready now the next thing we have to do is head back into our bot.js file and at the very top do const const is a defined word for a variable you can also use var or let but const is typically better as many people have suggested so you can do const keep alive do require and then do a dot slash server.js so this is requiring this file so it's going to take all of the code in this file and keep it over here all right so the next thing we have to do is we're just going to head over here at the very bottom and we're just gonna do keep alive so do that above your client.on so just keep that somewhere over here uh it should be above your client.on but below the code that's like over here so to keep our bot hosted 24 7 online we're going to use a service called uptime robot you can head over to uptimerobot.com and then create an account and confirm your email address so in your uptime robot dashboard which you can access after logging in and pressing this dashboard button press add new monitor and change this to https now over here we're going to give it a very friendly name we're just going to call this friendly name and then we're going to give it a url or ip so over here we're going to head back over here and press run so this is going to install our package and it's going to run this and as you can see this should pop up over here which shows that your bot is a lie so copy paste this url which is going to be leading to your rebel and paste this over here now the last thing we're going to do is we're going to keep this at every five minutes it's totally fine and if you want you can also notify yourself i'm not going to do that i'm just going to create my monitor and just like that we are set up we're all good so our bot is now running 24 7 for free congrats that's uh pretty cool now the last thing we have to do is add some cool functionalities and features for our bot if you came to this tutorial to create a simple moderation bot you can also do that if you created a simple utility bot or if you just found this entertaining and wanted to learn more there's a variety of different things you can do if you want me to make a video on all sorts of cool features and functionalities i can show you guys that step by step so all you have to do is leave a like down below if this video reaches 1 000 likes i'll make a follow-up video on a ton of cool features that scratch for discord has to offer if you need help feel free to join my discord server dsc.gigi rjain make sure to like the video if you enjoyed it or found this helpful in any way and with that i will see you in the next one [Music] you
Info
Channel: Rishab Jain
Views: 234,210
Rating: undefined out of 5
Keywords: discord bot, how to make a discord bot, how to make a discord bot without coding, how to make a discord bot without downloading anything, scratch, scratch for discord tutorial
Id: 8YoNsQO1Vso
Channel Id: undefined
Length: 14min 19sec (859 seconds)
Published: Fri Feb 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.