|
1 | 1 | # Self-Hosting
|
2 | 2 |
|
3 |
| -Self-Hosting the bot can be very challenging or trivial for you depending on the level of your technical skills. This article will help to choose which guide to chose when setting up your instance of the bot. |
| 3 | +If you want to work on bot or host it somewhere you can setup it with this guide |
| 4 | + |
| 5 | +### First of all, Bot Application |
| 6 | + |
| 7 | +To run an instance of any of Discord Bots you must first create the app on [Discord Developer Portal](https://discordapp.com/developers/applications) first. There are couple of good resources that will help you out |
| 8 | + |
| 9 | +* [Setting up a bot application](https://discordjs.guide/preparations/setting-up-a-bot-application.html) |
| 10 | +* [Adding your bot to servers](discordjs.guide/preparations/adding-your-bot-to-servers.html) |
| 11 | + |
| 12 | +### Local Setup Recommended |
| 13 | + |
| 14 | +#### 1 - Install Required Software: |
| 15 | + |
| 16 | +* [GIT](https://git-scm.com) \(GUI such [GitHub Desktop](https://desktop.github.com) can be helpful\) |
| 17 | +* [Node.JS](https://nodejs.org) |
| 18 | + |
| 19 | +#### 2 - Clone The Repository |
| 20 | + |
| 21 | +To clone the repository, either use the Git GUI if you have one installed or enter the following commands: |
| 22 | + |
| 23 | +```bash |
| 24 | +# if you don't want to contribute, just host the bot, nothing else |
| 25 | +git clone https://github.com/ReplacementBot/ReplacementBot.git |
| 26 | +cd ReplacementBot |
| 27 | +``` |
| 28 | + |
| 29 | +If you want to contribute, first [fork the original repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and clone the **forked** repository into your local machine. If you don't do this, you will not be able to make commits or change any files. |
| 30 | + |
| 31 | +```bash |
| 32 | +# if you want to contribute, make changes and work on the bot |
| 33 | +git clone https://github.com/<username>/ReplacementBot.git |
| 34 | +cd ReplacementBot |
| 35 | +``` |
| 36 | + |
| 37 | +#### 3 - Install Dependencies And Build Project |
| 38 | + |
| 39 | +That step will setup files on your local machine that are not copied from the repository. |
| 40 | + |
| 41 | +```bash |
| 42 | +npm install |
| 43 | +npm run build |
| 44 | +``` |
| 45 | + |
| 46 | +#### 4 - That's It! |
| 47 | + |
| 48 | +You can now run bot anytime by running |
| 49 | + |
| 50 | +```bash |
| 51 | +npm start |
| 52 | +``` |
| 53 | + |
| 54 | +### Gitpod - Simple Cloud Development |
| 55 | + |
| 56 | +If you don't want to mess with setup on local machine you can work on bot in the cloud in one click! Gitpod will serve you pre-build workspace in couple of seconds! **Note**: Free version allow for **50 hours / month** if you would like to work more, consider [Upgrade](https://www.gitpod.io/pricing/) or Manual Setup |
| 57 | + |
| 58 | +[](https://gitpod.io/#https://github.com/ReplacementBot/ReplacementBot) |
| 59 | + |
| 60 | +### Heroku - Simple Cloud Hosting |
| 61 | + |
| 62 | +You can easily setup bot to work 24/7 with heroku! Be sure to enter bot token when deploying, you can get it from the step above. After setup you need to disable `web` dyno and enable `woker` dyno from **Resources** tab or, your bot will [keep crashing](https://github.com/ReplacementBot/ReplacementBot/issues/60). This method require [ENV Configuration](https://replacementbot.github.io/docs/configuration.html#environmental-variable-env) if you want to use config. |
| 63 | + |
| 64 | +[](https://www.heroku.com/deploy/?template=https://github.com/ReplacementBot/ReplacementBot) |
4 | 65 |
|
0 commit comments