a way to Host a Discord Bot on Heroku for free of charge - Discord.py Rewrite Academic #5

broken image

This through both clicking the hyperlink within the . description or simply looking it up. you're gonna click right here and you will see.  groovy discord bot commands  have two BOTS so this one is actually. the one that's walking on my disk notice. server this one I simply created so what. you are gonna do is you gonna sign in or. create an account if you don't already. have one i don't think i have to stroll. you thru doing that you are gonna. click on new after which create new app now. it is gonna ask you for a reputation. ensure you keep in mind the name that you. use and it must be particular now it's. gonna ask you to like upload to pipeline. don't do this just i am going to show you here. just actually make a name and click on. create app and that is all you need to do. to create a new app and then we are gonna. suffer what I'm gonna do right now. ok so then you're gonna go to open.

Your app it's going to already open up. something like thiis okay. and we're gonna do goes to visit. what is it installation now it is gonna say. like it's gonna give you a few. directions on the way to install your code. to Heroku due to the fact sincerely what we are. gonna do is we're gonna add this to. Heroku and then we're simply gonna have. like a command that runs and it simply. gonna continually run our Python script. for us so that we don't have to run out. on a computer so we're gonna do this. utilizing git yet what you ought to download. first this Heroku CLI so i'll correctly. I will leave the hyperlink here for this in the. description besides but when you pass and. you're on here just click on this little. element here it really is Heroku CLI after which. down load that install that run via. that ensure you say upload to course if it. asks you to do that because you're gonna.

need  to try this in the command immediate. ok so once you're done that so pause. the video do this after which come again to. what i am about to do right now okay so. what we are gonna do now is we are gonna. have got to get into our directory wherein our. Python bot is so it is the listing. that mine's in its in machine Python. discord tutorial  you can now do this. from CMD I just like CD computer C the. Python CD discord academic and that's. first-rate now you are within the  directory but when. you desire an easier way to do this or. it is like genuinely some distance what you can do is. simply move up here and sort CMD within the . precise name of the directory so in that. folder and it will open up one that'll. automatically be the right listing. okay so once you try this what we're. gonna type in is Heroku login like this. ok now what this is gonna do is just.

Gonna pop up something that says whatever. like this it's gonna say press any key. to open up browser to login or cue to. exit so you are gonna hit input . key you desire and now you'll see that it. brings me to my browser and then you are. just gonna click on login and there you move. it's going to just aautomatically log you in. if it asks you to kind on your username. and password obviously try this and then. what you are able to do is you could near that. window and we will come back to the. command prompt and start following the. subsequent steps so clearly what we do now. is we need to set up a few files and. dependence dependencies for a assignment. due to the fact truly this goes to. upload to love a Linux server and it's. simply going to read via all of your. files and seek for certain documents in order that. it is familiar with what to do so sincerely the.

First thing you should do is really. create a anything known as a proc file. now it is gonna do is it is gonna tell. the server what file you need to run. like what python script because you. may have distinct Python scripts. so to do this we've to ensure we're. in the listing we're gonna type echo. like this and then this little what do. you name it like more than signal and. then we're simply gonna type the call of. our dossier which is gonna be proc dossier. like this a PR OC dossier okay and just hit. input now you mustn't see any output. here but when you visit will go back to. that folder right here. discord Python discord educational you. should see now you have a dossier without. file extension that asserts proc dossier so. correct click this and edit it with. either notepad plus plus that is. best or notepad and then what.

you are gonna do is one moment sorry it's. beginning up in my other display right here I. assume I'm able to drag this yeah there we pass. sweet so it is gonna say echo is on all. you ought to do is delete that last line. the second line come right here and type. worker ok and then Python colon log py. I believe oh i am I mess it up so it is it's. Python log py and you placed a colon correct. earlier than or correct after employee hit keep. like that do not deliver it a file extension. just leave it as like a blank file no longer a. txt or anything ok so worker Python. and logged up hi is that what I named it. no I named mine purchased a pie i do not. recognize why I'm doing it long so purchased pie. and that is gonna be the name of the. Python script you need to run so if you. named your like disc wherein bought then. you need to put that there. ok so we've that so we have now.

That within our listing we've got. to create yet another dossier in here that is. called the necessities dot txt dossier. now this dossier is gonna let us know what. applications that we need to download to run. this bot because obviously this doesn't. work on local Python this works utilizing. like that discord rewrite kit and. maybe if you men use pandas and numpy. you're gonna must positioned that in your. requirements out txt in addition so that you could do. this we don't need to do whatever within the . command immediate just go on your folder. click on new after which click a text rfile. like thiis ok now you need to call this. require mints dot txt now make sure you . spell standards correct i do know  that's. gonna sound stupid but I spelt mine. incorrect the first like 5 instances so trying. to upload this and i bumped into mistakes. so requisites i feel that's the way you.

Spell it so we will do that ok now we are. gonna open up this txt dossier and in right here. we need to paste a few things so i am. just gonna correctly paste them and I'll. discuss what they. and what one do you guys would perhaps. want which are exclusive from mine okay. so i am gonna paste these here now. i do know  this looks type of confusing but. in actual fact these are only everything. that it is gonna run pip on so it's gonna. run pip get dot this it's gonna run pip. pineapple edition 1.3 point O it's gonna. run pip panda's pip the NS Python pip. async timeout now the item is you would possibly. now not need aall of these like async time. out i feel instantly comes with. Python yet I need to make sure that it is. the correct version for Python 3 6 so. that's why I outline 3.0 point 1 right. and equal aspect with pineapple um. actually I don't believe this one.

immediately installs so there's any. packages which you men knew you had to. install using pip make sure you  positioned them. on your requisites txt folder like. pandas you need that one if you're if. you are utilizing that module and prefer you. would put numpy or the other one now I. will just say quickly in case you men are. trying to use an outside database for. this that it is gonna like upload to that. database as an example MongoDB that will. not work on Heroku except you pay for. just like the extension so simply caution there. because I tried to try this i used to be going for walks. into aa bunch of issues yet anyways. specifications no longer txt. you wish minimum this one you are. maybe gonna need the NS Python you are. probably gonna need pineapple different ones. you add in at your individual discretion ok. there we move so now you're almost mounted. to actually create a what's called git.

Repository and now add this to Heroku. so we've those I would truly. propose you delete this dot thought dossier. if you do not need it if like you're in a. what do you call it pie appeal so I'm. gonna delete that and now we will return. to our command prompt and we will begin. the next few instructions and actually sorry. before I try this I just forgot we are. gonna upload some thing to our I bought here. so i'm hoping you didn't near it yet visit. uh let's examine here settings and you're. gonna cross right down to where it says construct. packs we are gonna upload a Python build. pack so to do this we are gonna do add. construct pack we're gonna go to Python and. we're simply gonna keep Adjustments and that. is a feeling that's that is all you should. do to add the build pack just so it. knows we're gonna be running Python I. suppose it will immediately notice.

Anyways yet to make sure we are gonna do. that okay so now we are returned in our. command immediate and what we need to kind. now is i have to appear so I do not forget. so we're already logged into Heroku so. now we are gonna do get an it ok so. initialize the empty git repository in. this folder very well so. what we're gonna be doing now's we are. gonna be placing these kinds of documents that. we have been operating into this get and i'm. gonna be pushing that get to Roku and. it is gonna run the get and run all those. files ok so now we have done that what is. your next step okay so I'm just gonna. reproduction it in so I don't mess it up. but we are gonna type this a Roku get :. distant a and then name okay so name. you men have to alter this to whatever. the name of your application is so mine. is test bought 3 four five okay so. i am gonna try this a experiment bought 3.

four five and yours is gonna be whatever name definitely you named it when you have colon to ensure you had colon spread okay so we'll do this and hit enter and set get distant heroku to thiis okay perfect amazing next step we'd like to do this do get add dots now it truly is gonna add all the documents in our current listing into that get let's do this there we pass you shouldn't see any open for that if it really works and there is no errors you're well ok next is git devote o.k. a.m. and now in here you only have got to take whatever like whatever you desire in quotation marks you are gonna say we will assault why due to the fact when you devote something you only have to give a message so I'm just gonna say cool ok yet is not yeah it wouldn't be get would it would be get ok so what type get to commits a.m.

 

 

Cool and then 5  documents modified and. then it should suffer all this and. it say what it created into the get ok. so marvelous now our final step is to push. this to Heroku and after we push this to. Heroku we should always correctly be operating and. we are going to verify and ensure that means. fine so to do this we are gonna do get. push Heroku master okay and hit enter. and so you might see output like this. if you're not you did something incorrect move. returned and verify didn't push what is the. limitation. distant rejected grasp grasp pre. received hook declined o.k. provide me. a sec guys. ok so basically the issue was the. incontrovertible fact that this standards one before. this text file sorry in our listing. right here I had this dot txt extension so it. appeared like requisites dot txt dot txt. since it adds the extension afterwards.

That we won't see so that was the difficulty. so I just have to take away this dot txt. hit input we are just gonna need to. recommit to our get Riyad those files. this actually is sweet because it's. showing you like in case you ever. change whatever it really is the style that you. recommit Andrey push to Heroku so. imagine that worked exceptional and now we. change whatever we want to recommit. well what we do is you get dedicate am.  message you want okay nothing. to dedicate that's just because I already. committed and looked at or not it's or should. say like exchanging deleting whatever and. then we're gonna do get add interval  ok. now we're well now we are able to push to Heroku. so get Heroku push Mass get push Roku. master now i do not even ever vote it was. get push Heroku grasp ok let's try. that every thing up-to-date that is just. cuz I already uploaded it yet you guys.

Should go through this and iit should. work I ask for forgiveness for that mistake yet. it's aactually nearly kind of good. due to the fact i am displaying you tips on how to. reuupload stuff and consider it ok so. now that is there let's actually see if. this is working and let us take a look at some . log documents and stuff so let's cross test. server ok so it is not up yet so let's. see if we made any mistakes like in our. logs so basically if that doesn't work. for you what you can do is you could go. you could investigate your logs we are going. Heroku logs a and then regardless of the. call of your bought become so I don't even. understand what I named my test purchased . three 4 5  and let's see if that. pops up the logs me gonna take a look ok. so marvelous so it says set up release so. immediately it is build failed that was. that became previous but right this moment it. correctly labored.

So let's visit Heroku and let's flip. this on and and get the bot running. resources ok there you move sweet so now. we just have to truly turn this on so. we have worker Python potpie so that. confirmed up I did not just add this in so. let's go to this edit tab let's turn. this on let's hit verify and let's pray. that that's gonna work okay so now. we're gonna are available here and we're gonna. with any luck see in like 30 or 40 seconds. that this bot turns online so I will speedy. ahead and wow would you look into that. it's online ok sweet so now it is. working so let's test like hi there and then. we get hello lower back and there we pass our. discord bot is officially on Heroku now. last things i am certain you men are. possibly ready clicked off the video via. now yet with a view to see how to seem. at logs and the way to manually run stuff on.

This Heroku server what you can do is. you are able to do Heroku or. Roku logs a so like whatever I simply. versions a experiment purchased at 3:45 hit input. and then we'll run the most recent logs. for you so it will say like what become. created and iif you want to see the story. logs because regularly it would not do it. you are able to do logs  tale it'll show you. the ones at the top and let's see and. yeah so it is going by way of and it'll exhibit. you the logs and you can take a look so. if anything like failed then you'll discover. that now that allows you to run bash on your. server and like manually run Python. scripts what you can do is visit Heroku. run bash after which a again the name of. your BOTS o experiment bought  3 4 5 ok it. ought to just take a second to run bash. and then if you wanted to manually run a. python script you could kind python the. name of the script and it'll run it for.