How To Make Image Commands Discord Bot WITHOUT CODING

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome back to another video on the channel today i'm gonna be showing you how to set up image generation in scratch for discord if you're new to this channel you might not know what scratch for discord is stratfor discord is a software that lets you code a discord bot with a drag and drop block so it's not actual coding and it's super easy to make a discord bot with scratch for discord so to get started make sure to watch the first video on the channel if you haven't already in the second video to learn how to update your bot and you can also watch the other videos to learn how to become a pro at scratch for discord coding so make sure your scratch server is set to preview 454 and just click open scratch so if you go into the joe's category you'll see an image generation category which has these new blocks so i have think rumor in this server i'll use him for an example if i do slash and go to dinkbemer's commands and if i scroll down i'll see a bunch of image commands so for example image pet pet if you send that then it will take a while to generate and it will send a pat pat image of your profile picture and there's also i'll show some images that i know that are going to be in transfer discord too so image delete this is going to be in scratch for discord i don't know if it's the exact same thing probably somewhat similar there's also a mid trigger image trigger is also a gif not an image and you end with think beamer you can also send an optional user now with anything user deck neighbor i don't have any other people in this recording server you can also do it with any member so you probably already know how to create a command handler you can just go to command handler and then change the command to exclamation mark image or whatever your prefixes image and then you would have to make the arguments one required so you would set a first argument i don't think i've said this in any of my videos but we're going to be making multiple arguments so you want to create a variable and it's going to be named member in the first if i'm just going to delete this for now and then inside this block you duplicate this in list so it's going to be set member 2 and list arguments get and remove number one so what this is doing is just it's setting member to the first word in the list arguments so it already removed the command because it sets argument to a list so the message content is just a whole list and then the command is going to be set to the first word so if command equals this it has to be the first word and it also removes it from the list at the same time too so that's why when you do arguments the arguments variable is set to everything except the command that's because it gets removed you can also change this to get or just remove if you don't want it removed or you don't want to get it too okay actually made a mistake it it isn't going to be named member it's going to be image or type whatever you want this is going to be like the image that we're actually doing so you can do slash image pet pet gay delete trigger the image is going to be that so now you can create another member variable and duplicate this and make sure it's just number one again because now the number one is going to be the member since we already removed this and this so first we need to make the image required because they have to include a type of image they want the image generation to be so in the if you're going to put make text from list arguments with delimiter space equals null and then change the equals to does not equal and you can go to the settings and add an else so the else is if whatever this is is not true so go to messages and you can reply that you need to include the type of image generation you can customize this message if you want and then next we have to see if they actually mention the member or not because because even though the argument is required the mentioned member isn't going to be required you can make it required if you want but how i'm going to show you is just you can it's not required if it's blank if you don't do the mention number then it will just do it on yourself and if you do it'll do it on whoever you mentioned we're gonna add another if and in here we're gonna put if member equals no so this is gonna be if they don't mention a member we're gonna do an elsif and over here you can put you can just duplicate that and put it in this but instead of null we're gonna put mention member so if they didn't mention member then it's gonna be if member equals no then it's gonna do whatever since we're gonna put in here and else if the member equals mention member so that's just making sure that the third word or it's going to be an actual member so they can't just do image [Music] trigger and then test or like a word because they actually should mention a member and this that would make sure that it's not just a word like this but then we actually need another else so if they do something like if and then we need another else because if they do do something like that so exclamation mark image trigger test or something it actually does something so then you can reply please mention a valid number okay now we can get the actual command so in here we're going to actually identify what type of images is so i'm going to use trigger and i'll do one gif and one image so i'll do trigger for the gif and i'll do hitler for the image i don't know what that is i've never seen anything like that before i don't know what hitler will be like also i forgot to mention that you should make this two lowercase message content when it sets the arguments to the list i would recommend making it scroll down in text and make it to lowercase message content that would remove the case sensitiveness these make sure you would have these lowercase because if you have these uppercase then it would be impossible for the command to even activate so what this is basically doing is just making the bot think that the message content is all lowercase so even if they send it in ever every letter cap capital the bot would think that the message content is lower case and if these are located then it will match even if they did it all capital if image equals trigger do and now you have to go to image generation and send in channel image so in the channel you can just put message channel and image i'm gonna do the trigger one which is a gif so you would put load gif and inside load gif you would put gif new triggered of image the profile picture of the member and this image can be anything you can even put a text and put a custom image url so https image.com or whatever the image url is but there's not really any point of that most people just do a member profile picture and of course inside that block you would put message out there so that's basically it for the send channel block but i'm also going to go over some of the other blocks and that's basically it for the trigger command and now if you go to the settings of that if you can add an else if and then you can duplicate the equals and instead of trigger you can put hitler or whatever image you want if i were making an actual bot i would just do all of these it's actually really similar so i'm just going to duplicate this to make it faster and delete this so inside there you can put load image and then inside load image you would put image new hitler of image member profile picture message author and that's basically it for the image too so i'm also going to do this one this is image 1 and image 2 2 so you would still put load image and inside load image you would put this block which is image 1 and image 2. this would just let you send multiple images so if you if you're really advanced you would figure out how to do two mention members i don't think that's even possible in scratch for discord because there's only one mentioned member but i think normal discord bots can actually do two mention members so you can do the first one mention number one and the second one mention number two but i don't think that's possible in scratch for discord unfortunately command is activated then it would send a gif of trigger and profile picture of message author and the same thing with hitler it would send an image of a hitler image of a message author and if they actually mention the member you can just duplicate this and all you would have to do is just change some of the blocks so just delete these two message authors and replace them both with mention members so also quickly show you how to do slash commands but before if you don't know what splash commands are or how to set them up i recommend watching the video a few videos back which i made a few months ago that tells you how to create slash commands and what slash commands actually are so you can click here to create a new command i'm gonna make it image and command description is gonna be generate an image of your self or another member you can add a new command parameter and this is going to be a string and you can be type and it's i'm gonna make the description what type of image do you want to generate you need to make it require two and you can add a new choice of trigger and this can be the same thing it doesn't really matter and it's going to be hitler and this and click create and it should create and create another parameter which is going to be a user and option type is going to be member and it's the description is going to be who do you want to generate the image of and the required is off and click create and if i go to discord i immediately notice there is a new image command and also keep in mind that i also said this in the original slash command video i'm on the disk i'm only on one guild i'm only doing slash commands for one server if you're doing global slash commands then it might take over an hour to generate so if you did global slash commands and the slash commands are not coming up don't say that it's not working or anything just wait an hour but if it's just on one guild it usually goes on right away so of course on the type you can either choose one trigger or hitler and the member is either millionaire sam or dank bieber though it'll give you people in the server right now so let's actually start making the code so in this you have to go into the mr dorito category and go to slash when a slash command is received interaction name equals image and make sure there's no slash in here it's just the name of this this image that goes into the interaction name and then for the first parameter which is type we're going to put if get string option name and this is the option name so i'm pretty sure i named it type so this is a string the type of the perimeter is string and option name is type so that's whatever they put so it's either trigger or hitler in this case so if it equals trigger actually i made a mistake before that you have to make sure yeah well you have to check if they mentioned the member or not so if get member option name member equals null so if they didn't put anything for the member parameter and then send in channel i'm just going to duplicate this send and channel message channel image load gif new trigger of image message author and make sure to replace the message channel with the interaction channel else if the type equals hitler sent in channel introduction channel the image of hitler of the member profile picture of messenger and over here of course if they didn't mention a member we're just gonna simply change this to does not equal to and then we're gonna duplicate this again and change the message authors to mention numbers i actually made a tiny mistake here the message author is supposed to be interaction author and the mentioned member is actually supposed to be get user option type member okay so here it is it started it started everything correctly you might have this error but you can just ignore it so i'm gonna test it okay so first let's do image trigger and there it is it might take a while to load because it's actually generating an image but it actually generates a gif and it sends you through your profile picture as triggered and if i do image hitler it actually says it's like a news person and it says worse than hitler with your profile picture okay that's it for today's video guys tell me what video you guys want next i'm i'll probably do youtube notifier but if you guys want discord backup or discord giveaways just comment down below and i might do those i'll just do these in order i'll just do youtube notifier next time discord backup and giveaways so stay tuned for the next video and i'll see you next time [Music]
Info
Channel: Scratch For Discord Tutorials
Views: 597
Rating: undefined out of 5
Keywords: discord, discord bot, discord.js, codelyon, discord.js tutorials, how to make a discord bot without coding, how to create a discord bot without coding, js, javascript, javascript tutorials, discord.py, how to make a discord bot, how to create a discord bot, s4d, scratch for discord, scratch for discord tutorial, how to create a bot with scratch for discord, how to make a discord bot on mobile, how to make a discord bot python, how to make a discord bot visual studio code
Id: oIHFOOoUEdU
Channel Id: undefined
Length: 14min 20sec (860 seconds)
Published: Fri Oct 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.