[OUTDATED] How to make a Discord Bot using SCRATCH! Ultimate Beginner's Guide (Scratch for Discord)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody it's Kate and kapop here and it's been a while since I've done a tutorial but today I'm going to be teaching you how to make a Discord bot extremely simply this is going to be using an application called scratch for Discord you can kind of see in my Google thing because I've been using it but I'm going to leave all the links down in the description so you don't have to go and search everything up so we're gonna get right into it so right here you're going to type in this scratch Dash 4 dash discord.com remember the link is down in the description if you want to click on it it'll bring you to here I'm just going to cancel this we have everything over here as you can see the connect to Discord Block in the base category is required so here we have our workspace you can scroll around you can look you can have a lot of code if you don't know what scratch is it's a project or a program developed by MIT that takes the coding like the type coding that you would throw into a script and puts it into blocks so that you can easily connect them so it'll run code in an event based order so here every single time you create a bot you need this specific block this is called connect to Discord with the token your Bot token here you're going to need to put in your Bot token which we will create later but we want to set up our code first so that we have it ready now you can always go to examples and you can see they have all all of this stuff that you can use if you want to put it inside of your pot but I'm going to be teaching you how to do it from scratch in this video if you want to see more videos like this go ahead and leave a like and let me know down in the comments what kinds of types of code you'd like to see and how to make them so now that we had our base we're going to go to our logic and we're going to take this if block we're gonna do this example up here you can just click on if you want but I'm going to teach you how you can get these pieces so this is the ping pong command so if do so you can also grab other blocks and connect them as well but we're not gonna we're gonna leave that for later so if and then we're going to need to grab a where is it we're going to grab some setup blocks so message content this is going to detect If the message has a specific type of content then you're going to take this Eco block right and we're going to put this in the code first we just need to I just realized this we need to put a thing in here so you have events this is all event based blocks and stuff we are going to need when user sends message so we're going to go to message and it should be when message is received [Music] if and then we connect the equal block so if the message content contains right and we're going to go and we're going to find the text up here we're going to grab the string string basically is a line of just text that doesn't do anything other than output specific test text based on what you're putting in for example if I were to just have this out here as you can see it's kind of like boarded off meaning that it's not going to work if you put it in now it's lit up and this means that it's going to look for the content and now you can put in pink or whatever command you want them to be able to input so there is a way to make prefixes right now but we're just going to put the prefix in the content in general so if message content equals ping do right so now we need a response from the bot itself so we are going to come down here to respond respond with oh you can go Punk now what this will do is when it receives the message ping if the person entered specifically ping it'll come out with Punk and you can kind of just click on here and it should give you the same thing yep that's exactly what we built this is the example so now that we have this we are going to you can name it if you want I'm just going to name this but we are going to set up our application for application you're going to go to the Discord developer portal right and you're just going to go to get started and I'm just going to go straight to that from here all right once you've logged in by the way I will leave a link down in the description for this we are here in our application settings okay so what we're going to do is we're going to go up here as you see I have a bunch of stuff pop inv is the one that I'm making right now these three were just scratched because I didn't have any idea what it was doing so I'm going to come over here I'm going to create an application you don't have to worry about this we're going to name it I don't know why your mom is popping up probably something that I typed in here at some point like a couple years ago anyways let's just name it I don't know scratchbot all right and then agree and create and now you have your application note this application what you have to do well obviously you can just look at all this you want I wouldn't recommend it because we're going to go to bot anyways and we're going to build a bot a bot will basically run code so here you could do that and now we have scratch ball you can give it a nice you know little little picture or you can put in you know anything you want I guess for the name and anything so here always always equipped these three you need to put the privileged Gateway intents or else it will not work now we don't have to worry about anything else now that this is created you're going to want to reset your token and enter your six digit authentication code which I will do now once you have your authentication code entered and you get your token make sure to copy it copy the entire thing and then this will disappear after so if you ever want to edit your bot again and you lose this code you're going to have to regenerate it and edit all of your code and that would be bad so make sure to store it somewhere I'm going to just abandon the spot anyways after this video so I don't know if it won't it doesn't matter so here enter your token into here and I'm going to regenerate it right after this video so don't even try entering this and it will connect to the bot with this token now we have our bot here and we need to use two auth so that we can create a URL for our bot now before any of this we should go over and we should create a new Discord server I'm going to create a new Discord server for just myself and I'm going to name it so scratch butt create and we have our little test server that we can use so here we have our URL and we will give it the Bots scope now only put in what you want what your bot's going to need for example this one all it's really going to need is send messages so that it can send messages uh maybe you can have it read message history but it doesn't really matter and if you wanted to do all other sorts of stuff like if you want to make an administrator bot like someone that could kick something or or I should say kick someone ban someone you can always enable these and write code for those but be careful because if somebody does end up hacking your Bot that would be really really bad because they can do all sorts of things and you could get in big trouble so you do not want to do that so once we have all of our stuff here you can go ahead and copy the two off and just paste it into another tab here perfect okay so we have our bot right but now we needed to actually run the code that we have it here so it already has the code to connect but we are going to go ahead and we're going to take this and we're going to download it all right so we're going to download your Bot unzip the downloaded file all right we can do this later so once you have your Bot here okay now that we're at the bot we are going to go up to this website called Ripple dot it and once you get into Rebel you're going to see I already have my ripple right here you're going to go ahead and create a rebel and I would recommend JS and I'm going to delete this anyway so it doesn't really matter what the name is now that we're here we're going to have our code right here so our scratch bot is ready and I'm going to throw it in scratchbot server authorize and perfect here we go so we have this downloaded I would also recommend downloading WinRAR for PC you're going to need this downloadable software I will give you the right one because as you can see these are obviously fakes do not click on any of these the official one is the one right here with www.renrod.com if you download these you probably will get a virus so do not download anything that says add on it because they're just trying to steal your data from your computer and they're definitely viruses um so here connected Discord token we got our token right we also got our bot so now we're going to come up here and we're going to upload folder but before we can do that we need to go into our actual files we need to go into our downloads and we need to unzip this so we're going to extract it to a folder you can see the bot slash the slash just means a folder and so you're going to extract it into there so now we have our bot file folder whatever you want to call it we are going to take it and we are going to upload the entire folder once you upload it then you're just going to take everything out you're going to put the index.js and yes overwrite the files perfect here and so it changes up to index.js and that has all of our code in it right but here is where this gets kind of Rocky now here we have the login and we have our code now Rebel itself has a private feature but as you can see anyone can view and Fork this Rebel meaning that if anybody clicks on this they can easily get your Discord token which is extremely bad so then how do we fix this well we're going to have to go up and we're actually going to have to change this block of code and then we'll have to redownload it so here we are actually going to go over to base and we're going to click on process dot e and V process.env is an environment folder and only appears for the Creator itself in this new version of replit you're going to go and you're going to enter a secret so here we have a process NV and EnV I should say and now here we are just going to rename this to token this is going to store a value called token and I'll get to that in a second we're going to go up and we're going to create a secret we're going to name the key token so that it references the token and we're going to paste oh crap I need my token so we're going to go back to the bot and we're going to copy this I have to go back and paste it paste in the token and you're going to add the new secret so now this is an environmental value and nobody can access this when they go to 4K Rebel hopefully nobody does that but it is a public site unless you purchase a membership for private now we're going to go over and we're going to click on download and as you can see download your Bot we're actually not going to do that we're going to go over to settings and we're going to down files download files individually we're going to download both index.js and blocks XML I don't know if you actually need both of those but I'm going to download them anyways into their own separate thing now we're going to go back in we are going to upload new files or not new we're not going to upload we're not going to take new file we're going to upload file we're going to go over and we're going to click on blocks and index shift click on both of them to open both of them okay here I'm just going to make sure that we actually go to downloads oh wait don't go to the first one that it gives you go back into your downloads and then do this okay so then you're going to take this and you're gonna open them both they're going to overwrite and they should overwrite both hopefully I don't crash please thank you so now we have process.env string token boom and now it's going to reference this specific token so now if we go ahead and we run this code it's going to unpack everything you're gonna have to give it a minute to install it's if it it might pop up with an error like this it's Warren Warren no longer supported no longer supported that's fine all you have to do is once it's done go up here click stop and just restart it once you get this you should see once you get through all of this if it keeps giving you errors just keep running it and then keep stopping it until you get to this thing that says scratchbot 3105 is alive all right so we're going to go down to our Discord server and as you can see the bot is online if you're having any problems leave a comment down in the description I will be able to guide you and help you through because most tutorials they'll just leave you hanging I tend to read all my comments and I will gladly help if you got stuck anywhere along the way so here we have our scratch bot and as we go back we can see our code when message is received message content ping respond with pong now we're going to test out this code by typing ping and if my coding is right we will get pong back and there you have it guys that is how this works that is how you create a bot simply using block coding now when you go to run this and it will stop on its own if you ever turn off your computer or exit the application so how do I keep this up well it's actually pretty simple what you're going to do is you're going to go to the repo section under base over here this should be under all of this you're going to grab create web server with the text this site was created to keep the bot on 25 8 that's just a joke right there you can actually just edit this and edit with whatever you want so what does this do it's going to create a website and what you can do with this website is it will run it and what you can do is going to go to a specific website called uptime robot um.com and you can have a robot watch the website because as long as it's watching the website your Bot will not go offline and you can feel free to shut off your computer and close it down so I'm going to teach you how to do that now so here we have our web server with the text all right so what we're gonna have to do is we're gonna have to go back and we're gonna have to download these individual files again so these should pop up again you're going to throw it in upload files one two and you're going to open them here they're obviously not they're obviously taken over so we're gonna actually have to rename our stuff so I'm going to quickly I'm going to quickly redo that if you don't know what I'm talking about this is obviously not going to work because there's a one so all you have to do is go into your files I'm going to obviously blur everything out go to your downloads and just delete them all and then you're going to go back and you're going to download files individually now that you have everything back you can go ahead and delete the ones that we put in because they're useless now you're gonna upload the files again get the new ones that you just downloaded overwrite and now we have a website so we're going to go ahead and run with the new text is going to have to install and there we go this site was created to keep the bot on 25 8. now as you can see it gives you a website now what you're going to do is you're going to go to this website called uptime robot uptime robot you're going to log in or register for free all right now that you're on the dashboard as you can see I already I already have my other Discord bot that I'm working on you're going to click on add new monitor now with this new monitor you're gonna see all of this stuff here you're going to click on monitor type and you're going to click on https and you're going to give it a friendly name I'm going to call this scratch bot test because I'm going to delete this later I'm going to go over you're going to copy this website right here I'm going to paste it up in there all right now it will say given URL has an invariable account or has an invalid character that's because you just have to delete this perfect monitoring interval it should be fine at every five minutes you don't have to change that and you don't have to change out the monitor timeout now here I'm going to create monitor no alert contact selected you don't really need that it's fine and there we go monitor created now you can keep creating new monitors so I'm going to close and I have my scratchbot test and now it's going to take a second to load you can refresh the page it's going to take a bit because it hasn't looked at it yet so you can just wait for it to turn to 100 if it's not turning to 100 just keep refreshing until you see that green green little bar pop up and it should be watching this website meaning that you can close it out shut down your computer go off come back maybe go on your phone look on it at Discord enter in the ping pong command and it will stay on and that is how you work the bot this is how you can make a simple easy Discord bot without very very effortlessly I should say and I hope you enjoyed thank you guys so much for watching if you'd like to see more tutorials using scratch for Discord and you don't want to learn whatever all this is then go ahead and like the video subscribe um I know I'm not asking you to subscribe I'm saying if you would like to see more subscribe I don't ask for subscribers because I do this for fun I will see you all in the next video adios [Music] I hear
Info
Channel: KadenKAPOP
Views: 12,866
Rating: undefined out of 5
Keywords: Scratch, Discord, Coding
Id: SDed1UL5gTU
Channel Id: undefined
Length: 19min 12sec (1152 seconds)
Published: Mon Jan 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.