|
| 1 | +--- |
| 2 | +slug: /dayong/setup |
| 3 | +title: Setup |
| 4 | +tags: |
| 5 | +- Dayong |
| 6 | +- Python |
| 7 | +- Discord Bot |
| 8 | +--- |
| 9 | + |
| 10 | +## Bot Account Setup |
| 11 | + |
| 12 | +Follow the instructions here: https://discordpy.readthedocs.io/en/stable/discord.html |
| 13 | + |
| 14 | +## Bot Setup |
| 15 | + |
| 16 | +| ❗❗ Before you start, fork your own copy of SurPathHub/Dayong. | |
| 17 | +|-----------------------------------------| |
| 18 | + |
| 19 | +| ❗❗ You can also perform the steps below directly on your copy of Dayong on GitHub | |
| 20 | +|-----------------------------------------| |
| 21 | + |
| 22 | +| ❗❗ Your copy of the GitHub repository can be used to deploy changes automatically.| |
| 23 | +|-----------------------------------------| |
| 24 | + |
| 25 | +1. Clone your fork to your local machine. |
| 26 | + |
| 27 | + HTTP |
| 28 | + ``` |
| 29 | + git clone https://github.com/<your username>/Dayong.git |
| 30 | + ``` |
| 31 | +
|
| 32 | + SSH |
| 33 | + ``` |
| 34 | + git clone [email protected]:<your username>/Dayong.git |
| 35 | + ``` |
| 36 | +
|
| 37 | + GitHub CLI |
| 38 | + ``` |
| 39 | + gh repo clone <your username>/Dayong.git |
| 40 | + ``` |
| 41 | +
|
| 42 | +2. Go to the project root directory. |
| 43 | +
|
| 44 | + ``` |
| 45 | + cd Dayong |
| 46 | + ``` |
| 47 | +
|
| 48 | +3. Edit the `config.json` file and its values as necessary. |
| 49 | +
|
| 50 | + The `config.json` file stores public options, settings, properties, configuration, and preferences. |
| 51 | +
|
| 52 | +4. After setting up Dayong, `commit` and `push` your changes. |
| 53 | +
|
| 54 | +5. [Deploy!](../README.md#deployment) |
| 55 | +
|
| 56 | +### For local development |
| 57 | +
|
| 58 | +1. `git clone` Dayong to your local machine. |
| 59 | +
|
| 60 | +2. Go to the project root directory. |
| 61 | +
|
| 62 | + ``` |
| 63 | + cd Dayong |
| 64 | + ``` |
| 65 | +
|
| 66 | +3. Create a copy of `.env.example`. Don't forget to omit the `.example` at the end. |
| 67 | +
|
| 68 | + On Linux and Unix |
| 69 | + ``` |
| 70 | + cp .env.example .env |
| 71 | + ``` |
| 72 | +
|
| 73 | + On Windows |
| 74 | + ``` |
| 75 | + copy .env.example .env |
| 76 | + ``` |
| 77 | +
|
| 78 | +4. Edit the `.env` file and add your credentials to the corresponding variables. |
| 79 | +
|
| 80 | +5. Install [poetry](https://github.com/python-poetry/poetry#installation). Check if poetry is installed by running `poetry --version`. |
| 81 | +
|
| 82 | +6. Run `poetry shell`. This will create or start the virtual environment. |
| 83 | +
|
| 84 | +7. Run `poetry install`. This will install the project and its dependencies. |
| 85 | +
|
| 86 | +8. Edit the `config.json` file and its values as necessary. |
| 87 | +
|
| 88 | + The `config.json` file stores public options, settings, properties, configuration, and preferences. |
| 89 | +
|
| 90 | +9. Quickly test if the configuration works by running: |
| 91 | +
|
| 92 | + ``` |
| 93 | + python dayong |
| 94 | + ``` |
| 95 | +
|
| 96 | +10. After setting up Dayong, `git commit` and `git push` your changes. |
0 commit comments