Coding A Discord Bot Poll Botwhat's going on men welcome back to. an additional discord on this video today we. are going to be coding a pol pot in. discord IGS it is gonna be a brand new. bot as you will see that i've an empty. JavaScript file right here you men can comply with. alongside this is gonna be a little. special than my regular tutorials. instead of me sort of explaining how. matters work i am just going to be coding. and explaining what I'm doing but not. how the code works so it's gonna be a. little bit extra progressed yet we're still. gonna use virtually all the techniques. that we have got found out across my. tutorials when you are new right here that's. your channel in which I code one more. discord bots and i've a small sequence. in which I train you guys the fundamentals on. discord IGS and at present we're gonna be. growing our first bot that is going to. be a simple Pole bot wherein you're able.<iframe src="https://www.youtube.com/embed/oE6alzUzcw4" width="560" height="315" frameborder="0" allowfullscreen></iframe>To customise a pole and it's gonna be. extremely simple you may either thumbs up or. thumbs down the pole and that is kind of. how you may get a little information. from your discord using some kind of bot. like this but let's cross ahead and get. began so we've a new index. Naja convinced dossier we established discord ijs. and we did all of that with the NPM if. you don't know what i am doing or what. i am talking approximately. make sure to watch the first and second. video on the how to code a disk or BOTS. plateless. there'll be a link in description to. that and that ought to just about capture. you men up with what we're doing right here. so back brandnew file first things as. necessarily is we're gonna make it. constitutes gonna well-nigh hold the. required discord address as well as the. customers and we are also going to do a. prosperous embed so customers for now it truly is.not gonna pop out and increase embed and. this is going to just require and this. isn't the se6. i feel approach to doing it but we're. still gonna do it this type also require. discord is so this scored not certain there. we pass. and then we are only going to do a con. spots and it really is just going to be our. clients so we're gonna use bot as our. new customers o.k. extremely simple it is. in which we variety of did it the 1st video. in our how to code a discord bot sequence. after which we will get the token. so one more cons token and a 0.5 my. token here so permit me get my to. and we are just gonna add it into a. string right here we are not gonna do any JSON. stuff for now it really is very simple we're. commencing lightly and we're gonna. create a prefix and it's gonna be the. prefix of our bots and we're gonna. difference things up for our prefix of our.instructions we're gonna do P exclamation. mark and P is simply gonna stand for ballot . after which simply Commission mark just to. make it somewhat distinct than simply. a traditional you know P after which we are. going to possibly must login the bot. but before we log in we can do bot that. on and do a ready listener occasion. listener and they are seeking to flow it. in with an arrow function because it's. nearly especially easy to do after which. here we are simply gonna console that log. and we're gonna log the bots is active. and able to move there we go after which. ultimately we're gonna actually login into. our BOTS so we do bot that log in log in. after which we're gonna flow in our token. there we cross and a dead ringer for that we have got. our bot all set if we open up our terminal. here we do know space docks I do not know. why this isn't showing up it's gonna.Weird. the bots this entry room able to move. and if we open this scored did not we see. lion thoughts I really didn't make a brand new. pot yet we're simply gonna be using the. equal line yet I just essentially deleted. everything and we really create. a different textual content channel right here referred to as pulse. and it's we are gonna have the ability to upload. our pulse to a discord server so noticeably. cool there you pass our body's online. let's near that down and let's actually. start imposing all of the work that we. type of have got to so we are gonna use the. same approach to our command handler we are. no longer gonna do extraordinary files or an. specific progressed command Handler we're. just gonna do the basic one which we. just about doing all of our tutorials. and that's just the bots on and we are. simply gonna move my emojis bot that on. and we are simply gonna move in the message.Message and we are going to name that. message just to make it a little bit. more readable that is not a function. there we go open it up there we cross. and in here it's simply the fundamental splits. where we're splitting each of the arguments. so it's simpler to apply. permit are X it's gonna be equivalent to message. that contents sorry that ya contents. are not content material that is substring from. correctly. yeah that's substring and then we gonna. do prefix that length so the size and. we are just gonna split it up and we are. gonna open with rocks and then a space. and that is gonna let us use all of. the arguments so the 1st second all. the arguments so truly how our bot. is gonna work is you're gonna have the ability to. do P slow mesh mark after which pull and. then you're gonna be capable to variety. whatever like this or let's do a. question boxes as a poll so should I upload.a brand new BOTS to the server whatever like. that right and good it's gonna occur. is first the Alliant bot is gonna send a. just a poll wherein people can thumbs up. or thumbs down and in after a while it is. gonna delete this message so you know. whoever you know the admin whoever ship. the message that gets deleted and then. it is simply gonna maintain there and the. people can vote if they want it or if. they don't it's extremely simple so it is. how we're gonna structure it so we are. getting each of the arguments right here. it is the arguments that we need or. getting all that once we're doing this. args here and type of defined. the code which I suggested i would not yet hiya. that'll s let's do just it very well let's. do a swap fundamentals and we're gonna do. with the first argument so argument 0. and for this we are gonna do a case and.So https://mega-dance.info/confession-bot-discord/ and for the case we are gonna. do pole definite pole that is what we stated. let's cross forward and wreck just to make. sure we do not break our code right here and now. we are able to do matters i think the first. component we should always might be do is create an. embed due to the fact we additionally want to have. another command we want to have a. command of pepole and if they do not do. any arguments we just want to ship like. a assist embed announcing hiya it's the way you. do stuff so that is how you actually. switch on the pole and then that is how. you activate the embed with all of the. assist stuff so if we do an embed it so. Const and we are simply gonna call it n. bits it is only gonna have one equals new. prosperous embed and this what we did last. episode and it's very simple so we're. gonna do an additional dot and that is it the. colour I believe I had an exceptionally cool colour.I found yeah X these you're sorry zero X. and it's FF c300 if i am correct that. it is like a cool orange color that I. like and i am gonna say the identify of this. em bed shall we do initiates ballot or. something like that just how we are gonna. assist the member or the admin sending the. poll and iin the set description. we are only gonna type. ppull to initiate kind initiate a. simple yesor-no poll style of thinking. of this as i am going along and iit's kind of. kind of adverse okay so there we go. we created an embed and now all you desire. to ascertain is if there are only 1 . arguments if there is multiple. arguments we wish to do whatever else. then it's only you recognize one argument so. we want to verify that the participant or the. member despatched something else after the. first arguments so if not the args one. so there isn't any arguments for our x one we.Are just going to message that channel. that's despatched and what you send the embed. and what is it gonna do if we really. sign in runners yet this is if you recognize. it is in accordance with an order Bob and come right here. our aspect correctly works so if you do P. isolation markpaul it is gonna ship the. embed kind of helping out how it really works. so the botanist feel and iinitiate. provoke a ballot try this command to. provoke an easy yesor-no ballot it is. easy and now if he has multiple. arguments that's what we want so we. can create the name of the ballot we are. going to do couple things first things. first is we are going to create our our. own variable that is gonna store the. arguments but it is going to get rid of the. first arguments because the first. argument is of course sorry issue is of. course the command itself. so we wish to get all of the arguments yet.get rid of that first people so it does not. affect the name of the pole you know. they're trying to create and hopefully. this makes sense in a bit but let's simply. pass forward and permit message arcs that's. what i am gonna call it equivalent arcs that. slice slice sorry. I want to slice the first first of our. arguments which is naturally just our. our little command here and then we're. gonna do is we're gonna join it back up. together similar to stitching it we are. style of eliminating the first components and. then sewing every little thing returned together. so join then the citation marks the. area after which a colon at the top all. right and that is gonna let us use. all the arguments after the first. argument and that way they can. create a poll very well then we're gonna. just do a effortless message that channel dot. despatched and here we're gonna get a bit.resourceful so I have some emojis to make a. little bit extra you recognize visual and type. of somewhat extra interactive so the. very first thing we do is fundamentals we are just. gonna pass in the message artists correct. right here that we created right and i'm gonna. depart it like this I am not gonna mess. I will do the visuals later but then we're. gonna do a correct ten and which to do your. message reaction and it truly is the. significant parts and we do an error. function open this up and what we are. gonna do this is we are going to react. to the message that the bots conclusion with. emojis so you'll see our ultimate. result here in a bit of so a message. reaction that's we act and let's do that. two times in this school address and GIS is. somewhat shrewd so you may. do is you can go to emoji web content and. simply reproduction an emoji so we're gonna copy.Thumbs up and we're gonna copy B thumbs. down and as you'll find we're pretty. a lot done with our bot we're gonna you. recognize difference some things to make it a. little bit extra visual and now if we do. know it's speed dots and run our bun. returned if we do the just aa normal command. of p exclamation mark pull with none . arguments it's gonna send that assist. and bed and if we want to create a ballot . so we do ps commission market poll and. whatever like up here which we had this. right here should add and you obtain to. the server it's going to its was there a. problem there has been no obstacle what. occurred here it did not ship message out. of the send my RX that message reaction. what occurred here there's one thing I. did forget if I remember actually we do. have a destroy here in the 1st. arguments yeah i think there's a wreck.but hmm. it should be working very well let's. in fact we load everything again one. more time perhaps then load correctly. correct yeah it in lo correctly alright. so this will take place the bots send. precisely what the arguments turned into so ought to. I upload a brand new pod to the server after which. he reacted to it with the thumbs up or. thumbs down now individuals of this server. can actually vote if they need to you. can actually vote two times it's just it is a. element discord does with reactions yet. you they could vote if you know they wants. you to feature in you purchased the server or. something like this very simple however the. genuine bot works already so I'm able to fairly. a lot do anything like he's minecraft a. good online game I really don't know it does not. topic right and then whilst this happens. the bot will create the ball and then. people can actually click that and.Then that is it and then make sure that. other people aren't ready to react to or. upload a different response because somebody. would do like reactions oh wait can you. do thiis probably not all here. right they are able to do this but you may edit. this through these server settings so. ensure persons cannot really mess with. the response we're not going to be. imposing a few kind of method in the. coding. this video it's gonna be a bit of. too progressed all today let's. correctly make this a bit of bigger. by way of doing some things first things first. is we're gonna make it look enormously and. then we get to look rather is we're. gonna make thiis part right here bald so. it sticks out and the way we do that is. we have to form of add this little. things earlier than and after my message or. the message arguments here that are the.Time symbols here and you have to. upload two of them before and after and. this is actually how you add a bold text. on discord so today if I desire to. have anything formidable if I clone of formidable. good that is already ambitious if I type formidable. nothing happens but if I do of the I. don't know why this is named I'm sure. known as a multiplication things and that i did. to it either side it's aactually gonna be. formidable so we're gonna add two things. in either side so it's gonna make our. message bold and we're correctly gonna. upload one other thing at first and. we're simply gonna add an additional emoji. website so it makes a bit more especially. very well so it is run exactly all we. have right here. am i able to please thanks and let's go. creates that exact same ballot of. Minecraft being an excellent game and now this. is quite bold and it stands out.o.k. the very last thing we are gonna do. is we are gonna get rid of what the admin. just stated so it doesn't seem like he. initiated a ballot and we are gonna do that. by using coming again to our code which one is. it this one here and what we are. gonna do is contained in the den we're gonna. do message delete and run do five. thousand that is I believe it's around. like 5 seconds also I'm gonna do a. trap just in case there's an mistakes. swings within the console that errors do you. genuinely don't have to try this but there. maybe an blunders and let's go forward and. type of reload our bot right here and now if. I'm an admin and i am including this poll. here so let's do a very from. Paul so Paul and MSA is League of. Legends a great online game correct and that now. it is going to upload the ballot and it's. desire to delete this message that I simply.despatched in around 5 seconds there you go. so now it seems like the bot just sent. the message with the aid of himself while not having to. show what command the admin just sent. and we will we can form of make this a. little bit quicker if we want to do. whatever like 3000 that is gonna pretty. a lot delete it enormously fast in case you move. returned here and let's do a further poll why. not is bloodless lie on a good youtuber right. and it truly is gonna be a little extra. quicker and there he goes and of course. you should do oh that's a thumbs down. thumbs up that's style of awkward also. why is this first and why is that. second this could be first it's cleared. I believe it's just messing up with the. reactions however it should be perfectly. great yeah it is perfectly nice o.k.. with that being stated i feel that is. gonna finish this whole little bot.That we created here as you will find it is. extremely simple it only took us approximately 40. lines of code but then there's areas in. among can II actually format this it's. might be already perfectly formatted. yeah it's. i am just that good but that is highly. a lot it as you can see we created. something very simple a pull command I. imply it is it does in actual fact sincerely. Isis gets like you can't surely make a. extra elementary button this with that being. stated i'm hoping you men delight in this video if. you're new here make sure to check out. my tutorials and ensure to reviews. within the remark area lower than if you have. any hints for some form of video. like this if you want me to code a bot. with no need to do an instructional approximately it. and clarify every little thing simply me coding. and type of revealing you the way the code. works then make sure to depart a comment.part under and I'll type of study . through every little thing if it is too. difficult I'd pull it off for. later if it's easy like this i would. begin doing that now and finally ramp. up that is in which we get you recognize some big. BOTS with you recognize crazy implementations. and stuff but for now it is very simple. couple matters about this box you need to. say before I go away you is if you. in fact gonna make this right into a viable. bot and both sell it or you know positioned. it obtainable make sure to upload a. permission so not every person intend at a. pole unless you desire everyone to have a. pole or whoever you're making this bot. to 1 stuff everybody know have the ability to. add a pole so upload permissions upload. cooldowns make this purchase a little extra. viable for any large server when you are. trying to promote this or positioned it obtainable. but for now this is easy if you.


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-01-19 (水) 04:04:12 (827d)