About finewriter3

Description

Code Your own Discord Bot - Call Of Duty Discord Bot (2021)
What is going on guys welcome back to. yet another discord.js academic at present we are. going to be coding a. call of obligation discord bot i personally. coded this in the course of a live move so if. you men desire to see extra live streams. make sure to join this channel. as i'll be coding distinct bots during a. live stream. so the api that we are gonna be utilizing is. this one here it is known as the decision. of duty api. i am gonna have this in the description. lower than the link to this come right here. visit the doctors down right here and it really is we. can find all the info that we're. gonna be utilizing. so what you're gonna need to truly. connect to name of obligation is a username. and password which is just your standard. username and password. if you are attempting to log in to the decision of responsibility. website and as you can see the systems. that this api supports.
Is playstation steam xbox battle.internet. i feel this is activision and there's. additionally a number of identifier. if you may get plenty of information. through the variety i am not sure. what it truly is but chiefly. you're going to be using the ps. a few steam some of the xbox. and the battle.web platforms so all the. manner down here there's actually a couple. things that you'll verify. the first one is all the call of obligation. multiplayer video games starting from. i believe black ops 4 all a way to the. current call of responsibility. as well as the battle zone information so if. you want to so that you can get. information regarding warzone. you may do that as well so make. sure to envision this. out in the outline less than if you want . to determine what all the api. or this api wrapper right here is going to let. us accomplish that let's go forward and start.

Open up your task if you're new right here. make sure to watch the entire overall. playlist if you're misplaced. as we lately restructured all of our. task. first thing we have to do is go into. your env file. and we will create variables. right here that are gonna hold the. name obligation username as well as the decision. to the password. now i'm gonna pass forward and sort my very own. name to the username and password here. and ii'll be right returned okay so i. entered my username and password right into a. dot env variable. we will create a command what. we're going to in actual fact do is have the ability. to type and really i can show you. in view that i coded this in a. stay move we're going to be capable of. type mp examine. the battle.internet or psn or xbox ign. as well as the platform that we are. checking and the physique is gonna ship. an embed like this with assorted stats.
in response to the username so these are my. stats for name of responsibility they're exceedingly. bad. damaged able to see the games performed the. wins losses my kd. what number kills i've gotten that that is. um our longest kill streak and the whole. time performed. so to do this let's return into our. assignment. create the command mp check or whatever. you must call the command. so mp examine dot js and. we'll do the common. module.exports and get our command. jogging so the name of it will likely be. the same call as the dossier so if you. verify. you can add a description if you want so. this. uh description and outline can be. uh this command. shows stats or call of duty. would not topic what the outline is. go forward and do the execute method. execute we are gonna move in purchaser we are. going to pass in. message args and since we will be.
Doing an embed we are additionally going to pass. in discord in addition. and because we're going to be getting a. lot of knowledge from the api. it is advisable to need to do or correctly. you do have got to positioned an async right here. before the execute method so it's. asynchronous. and let's move ahead and get started so. like i showed you right here there's a couple. of things that we'll ought to. examine we're going to verify that they. sent. a username as well as the platform. of the user so we are going to need to. examine for the first argument so if the. first argument would not exist we are. going to ship them a message asserting hi there. please input the username of whoever you. want to lookup stats for. so correctly the first one is a nil and. we'll return a message. go back message.channel. dot send and we are gonna ship a message.
Announcing discord girlfriend bot . enter a username after which for the second one. arguments we're gonna assess those. arguments to boot. and this one's to be for the platform so. message that channel. that is not it message uh the channel. let's send i'll send. please enter a platform. following this we'll get the. username and the password that we installed. our dot env. so we're gonna create a variable called. username so let username. and that's gonna be equal to technique. and truly let's import. dot env right here so we are gonna do require. uh dot env dot config when you have no. inspiration the way to. shop your variables your safe api keys. and every little thing on a dot env dossier make. sure to observe the video as i do have one. during this playlist. so it's gonna be approach that envy. dot and we named it cod underscore. username. and then let's password equals procedure.
Dot env dot cod underscore password. subsequent we're gonna do a try to capture so. test and then we're gonna have a seize. right here with an. mistakes and one on error curse we are gonna. send a message to the user announcing. hey there has been an mistakes fetching the. participant so we are going to message the channel. ascend. there was an blunders fetching. this participant and then we will. sincerely throw the errors we get the mistake. within the console. so anytime a person enters a incorrect. platform or a wrong. username then we're gonna send this. message right here. next we are gonna in fact move forward and. install the package i must have completed. this at the beginning of the video but. open up your terminal and do. npm install call of duty api just like. this. you can also get this here within the doctors. here set up we are in actual fact simply. installation this here.
So install that and it should take a bit should not take that lengthy and we are just going to move forward and actually just require this into our command here so we'll do cons automobile underscore api equals require and we will require the call of responsibility api and also do empty parentheses like this let's move forward and log in into the actual api so we start getting information so wait cod api dot login and here we will log in utilizing our username in addition to our password there we pass and now let's get all the data from the api so allow data equals weight cod api dot and it's wherein it receives fascinating you can do many stuff um you may get the information from warzone from black ops 4.
we'll be doing the present call. of responsibility that is cold battle so it's bloodless. war. um sorry cold conflict and we're gonna get. the multiplayer stats of it so cold conflict. mp. in here we are gonna pass in the gamer. tag in addition to the platform. the systems are actually displayed. over again right here within the medical doctors. all of the manner up right here they need to. specifically put those. uh structures right here as their second. arguments. so on the grounds that we are gonna be doing combat.internet. it is gonna must be fight. now we are gonna do thiis through an. precise embed. and getting the arguments of the user. but i simply want to show you guys the. precise data that we are getting. so i'm gonna cross forward and tough code all. of my data. so if you come right here this is here my. video game tag gamer tag i will placed this. identical to this and. the platform goes to be fight which.
Is battle.web. and pass ahead and try this and i'm simply. going to console.log. the info to determine exactly in which we are. getting from. the api so i will pass ahead and. clear. don't space dot return into our. discord. and we are going to pass into cod stats. and it's referred to as mpmp. assess and well let's do just a. random username and a random platform. and let's return into our assignment you. can see we bought a number of data. based on that gamertag and that platform. what we wish to get. is we wish to get the live time and then. we additionally desire to get all. so to actually investigate the stats of. multiplayer come here to information. do dot light time after which we're going. to do. dot all dot homes. residences so let's try this yet another. time just to reveal you what we are getting. again from the api. so no area now not go back into our discord. mp talk over with the random username.
whatever like this. and then in here there it's all the. information about. my um you recognize battle tag or gamertag. and the platform. this is all we are gonna need so that's. what we're returning from the api. let's actually layout this and put it. within an embed. so in place of tough coding here in the. information we don't want to hard code it we. desire to get the user's information so. someone can actually. enter the actual gamer tag and the. platform and not being hardcoded we are. simply going to do rx0 and in. right here we will do args 1. so the. second argument is going to be. the platform the 1st argument goes. to be the actual gamertag. there it is aand then let's create and. embed it so. const const embed. is equal to new discord dot. message message embed. after which in here we will do some random. things like set the color.
Of the embed i'm simply going to get a. random hex colour. yeah this one appears nice this one correct. right here. and now we may also set the title so set. title. and the title goes to be cod. multiplayer. stats and then to the. description set description you do not. have to try this i'm simply kind of. customizing. um the actual embed but this is not. required right here and for the description. i'm simply going to sort something like. strange stats it would not really count you. guys can customise this up to you. prefer. after which we'll add the fields. that is the biggest part so. fields. let's open this up and let's get all of the. fields. set up so the first box and iif you. correctly determine right here what i did in my. live circulation the first box is going to. be video games performed. then wins then losses then kd uh then. kills and deaths after which all of these.
Fields here. so let's cross ahead and get started so. first box changed into going to be the games. played. so the first one is name let's do the. box of names called games performed. and most of this actual tutorial is. going to be me customizing. the embed i already confirmed you how to. get all the information you are able to do. whatever you desire. with the aid of just doing this here so right. now we're just going to customise it. so at this point you guys can actually. depart the video and customise as much. you want yet which will stay here. and watch me. in fact create the embed then you're. welcome to so importance. and the cost is going to be data and of. path the lifetime. that all dot prop consistent with tees. and ii think it's total games performed. i will cross ahead and duplicate this. right here so i don't have to type this. exactly each time.
So i'll replica this and then also. inline is. real if you know what inline is it is. actually in lining. um like this so this is an inline this. isn't. so it doesn't make a brand new area each. unmarried time and we can actually have. this manner right here within line so then. we're gonna do the subsequent one the subsequent. one's gonna be. the winds so call it is gonna be. winds the price is gonna be. this dot wins and then without a doubt inline. it's to be genuine. in line it is correct let's go to the next. one. next one's going to be the losses so. call. it will be losses so losses the. magnitude goes to be. this dot losses. and then the inline. and truly i am just gonna pass ahead and. copy all of this and just edit it. so it goes from i feel we're gonna do. kda subsequent. kd ratio pd ratio and it's gonna be all. the style here to. kd ratio ratio.
Next one is gonna be the kills skills. kills after which roll the way right here it is. going to be kills. kills and line real then it's going to. be the deaths. and then over here is deaths they land. genuine. and now let's do just the additional two down. right here that is the longest kill streak as. well as the total time performed. as long as kill streak one final one. call. longest kill shriek. significance that is not what i wanted let's get. this here. and that is gonna be what are we getting. i think it is the longest. hiill shriek and at last the gate the. total time performed. so let's do call total. uh total time performed. with a price of data that each one properties. and ii think it is time for some cause. it's. spelled in another way time performed total. now there is gonna be a problem with this. here yet i'm gonna show you guys. the answer.
but from this all you are able to do is i'm just. gonna set a setter just a footer sorry. so set footer. uh that set footer and for the footer. i'm simply gonna write random things so. cod. stats by means of code lion and. ultimately finishing this off let's cross ahead. and do just message. that channel that is send embed. so if we run our bot right here so let's shop. everything. on our bot customary space now not cross into our. discord server. go ahead and replica this right here we are. going to determine. that it will ship the embed. and it truly is in which we're getting lower back now. as you will discover the total time plate. is bizarre but apparently name of obligation. tracks the whole time plate with. seconds and we don't need this we want. to get the. precise hours like i had all of the manner right here. however it appears like everything is fine. video games performed wins. it does look a little one-of-a-kind from.
How i did it with the actual stay stream. that's due to the fact i took more time doing it. with the live flow. but thiis works you men can customise it. as much as you want let's actually fix. this right here with the full time plate. so if we're getting seconds we need to. convert the seconds into hours. and the way we do that is through first. parsing this as a drift we're in fact. getting a string right here from. the api we will parse it to a. float after which we wish to divide it by means of. 3600. and then we additionally desire to do two fixed. to the second one decimal area. so let's actually get all of this let's. put it all. in parentheses after which do one other. parenthesis called parse drift so parse. floats. with one other parenthesis. after which between both parenthesis at. the top what we want to do is do two. constant to fix. after which and we also desire to divide.
every little thing by. 3600 and that truly converts seconds. into hours. and at last all the manner at the tip what. we wish to do is do. plus hours so we actually inform them that. we're calculating hours. so plus hours and if we pass forward and run. this. we'll see all of the way back here. let's do a similar command let's reproduction. this. and iit's going to say there has been an air. fresh participant what is the difficulty. there was an blunders parse waft isn't. defined oh. that's speed float it's parse parse. float there it is clear. all as we speak it's going to work flawlessly. the image of that there we move we parsed. everything and we're moving into hours. rather than seconds. and there you move you created a decision of. duty discord bots. another time come here to the doctors there is. a lot of factors you can do you can. create a battle zone so you may rather than.
Doing mp. checked that's multiplayer assess you. can do battle zone. assess and get all the stats for warzone. or name duty black ops 4. or contemporary war and there is a lot of. things you will get the. complete store loot cod features. um all these loopy things i'm not much. of a decision duty player but you will get a. lot of factors here with this call of. responsibility api and actually suggests you the. response. everything that you are getting and likewise. indicates you a brief example on how to log. in. and the way to get all the info that. you're going to want so with that being. pronounced i'm hoping you men enjoyed this video. it's aactually anything. very um very fascinating here that we. coded. i admire doing bots like this which is. type of specific and getting information. from. diverse persons um as you will find our. pot is playing name of responsibility we additionally did.

Listing

Sorry, no listings were found.