Today I am going to introduce a new tool I have found recently called scratch-for-discord. You may have heard of it already, but today I am going to show you how to use it and create an awesome bot! If you need some extra help with some element of this or if the download/web-app isn’t working as expected then you can ask about it on our discord!
Now, you can either use the online web-app or download it (I would recommend downloading it because there are some extra features on that version that you will probably want later on) but once you have a screen up that looks something like this:
Discord Developer Portal
First of all, we want to setup a discord application and bot on the developer portal. This probably sounds complicated if you haven’t done it before but I will try and break it down.
To start, open this link. If it prompts you to log in to discord, do so and it should take you to a page that looks similar to this:
Next, click the “New Application” button
Give your application a name and click “Create”. I called mine “Example-Bot” but you can call yours something completely different.
For now, you can leave the screen you see alone (it should look similar to the one in the following image) and instead click on the “Bot” button:
Next, tap “Add Bot” and then click “Yes, do it!” on the confirmation screen that pops up.
If you want to, you can give your bot a profile picture and name but it isn’t necessary at the moment. There are also some settings that you can customise below but you don’t need to (they include things like whether it is a public bot and permissions). What you will want to do now is to click the “Copy” button to copy your bot’s token to your clipboard but you can also click the “Click to Reveal Token” one which will let you see it. A token lets code control the bot and is a long phrase made of random letters and numbers. DO NOT SHARE IT WITH ANYONE ELSE.
Scratch For Discord
I am using the downloaded version of the app but the web-app works in virtually the same way. To start with you need to get a “Connect to Discord” block from the “Base” category. This is what you need the bot token for. Once you have dragged the block in, paste your token in.
To start with we are going to make a basic ping command. Drag in a “When message is received” block (which can be found in “Messages”) and an “If, do” block (from “Logic”. Attach them together:
Then, drag these blocks into the “If, do” block like I show: (The “=” block can be found in “Logic”, the “Enter Text” one in “Text” and the “Message Content” one in “Messages”)
In the box for entering text write something like “!ping” or “/ping”. This will be the trigger that you run for the ping command.
Add a “Reply” block from “Messages” and in it put a “Message Embed” in it like this: (If it doesn’t have any of the boxes like in the following image then click the settings cog and tick them)
Now we are going to fill these in. Drag an “Enter Text” block into the “Message” and “Title” sections. Then drag a “Color Block” into the right section. Now, add some text into the inputs and pick a color. It should look something like this:
In this tutorial, I’m teaching you all of the different options but you don’t have to use them all. I’m now going to add an image but you don’t have to use the embed like this, you could have only a title or only a message. To add an image (if you want to) I would recommend adding an “Enter Text” and writing the URL of the image into it like this:
Adding The Bot!
Now that you have created the bot, you need to add it to your server! Go back to the discord developer portal and make sure you have your bot selected. You should now click “OAuth2” like this:
Scroll down to the bottom and you should see a tick-box menu titled “Scopes”. Find the option in it called “Bot” (circled in red) and tick that. Then scroll down to the bottom where some new options will have popped up. Select all of the permissions you want from it (or just click administrator (circled in orange) which gives it everything). Now, if you scroll back up a bit you will see there is some text (circled in green). Open this link (or send it to others) and they will be able to add your bot to their servers. If you open it, select the server you want and add it (you have to have the right permissions on your server. There are several images to show this all (your link will be different to mine):
Thanks for reading this! You will notice that your bot is offline at the moment in any servers it is in. That is because it isn’t hosted yet! You can visit here (there official documentation) to read about potential options for hosting but I am going to show you how to host it on your own computer and using something called replit in the next articles. Once the next articles have been released there will be links here pointing to them!
Thanks again and happy coding!