Skip to content

Commit

Permalink
docs: cleaned up windows_wsl.md
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub 'Eremiell' Marek <[email protected]>
  • Loading branch information
Jaskowicz1 and Eremiell committed Sep 9, 2023
1 parent b190f66 commit c73ca76
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions docpages/make_a_bot/windows_wsl.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
\page build-a-discord-bot-windows-wsl Building a discord bot in Windows using WSL (Windows Subsystem for Linux)
\page build-a-discord-bot-windows-wsl Building a Discord Bot on Windows Using WSL (Windows Subsystem for Linux)

This tutorial teaches you how to create a lightweight environment for D++-development using **WSL** and **Visual Studio Code**
This tutorial teaches you how to create a lightweight environment for D++ development using **WSL** and **Visual Studio Code**

This Tutorial will use WSL's default distribution, **Ubuntu**! You might use other Distros if you prefer, but keep in mind the setup process might be different!
\note This Tutorial will use WSL's default distribution, **Ubuntu**! You can use other distros if you wish, but keep in mind the setup process might be different! If you're aiming for production, we recommend you continue your path of becoming the master of all Discord bots \ref buildcmake "by visiting this page", otherwise keep following this guide!

1. Make sure you have installed your WSL 2 environment properly using [this guide to setup up WSL](https://docs.microsoft.com/en-us/windows/wsl/install) and [this guide to connect to Visual Studio Code](https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-vscode).
2. Now open PowerShell as an Admin and type `wsl` to start up your subsystem. If you want to set up a CMake project (recommended for production bots) now, consider continuing your path of becoming the master of all Discord bots \ref buildcmake "here", otherwise keep following this guide!
3. Go to your home directory using `cd ~`
4. Download the latest build for your Distro using `wget [url here]`. In this guide we will use the latest build for 64 bit Ubuntu: `wget -O libdpp.deb https://dl.dpp.dev/latest`
5. Finally install all required deps and the library using `sudo apt-get install libopus0 && sudo apt-get install -y libopus-dev && sudo apt-get install -y libsodium-dev && sudo dpkg -i libdpp.deb && rm libdpp.deb`
2. Now open PowerShell as Administrator and type `wsl` to start up your subsystem. You may also type `ubuntu` into your search bar and open it that way.
3. Head on over to your home directory using `cd ~`.
4. Download the latest build for your distro using `wget [url here]`. In this guide we will use the latest build for 64 bit Ubuntu: `wget -O libdpp.deb https://dl.dpp.dev/latest`.
5. Finally install all required dependencies and the library itself using `sudo apt-get install libopus0 libopus-dev libsodium-dev && sudo dpkg -i libdpp.deb && rm libdpp.deb`.
6. Congratulations, you've successfully installed all dependencies! Now comes the real fun: Setting up the environment! For this tutorial we'll use a as small as possible setup, so you might create a more advanced one for production bots.
7. Navigate to a folder of your choice using `cd your/path/here` or create a new directory using `mkdir MyBot && cd MyBot`
8. Now that you've a folder to work in type `> mybot.cxx` to create a file you can work in!
9. Now you can open this file in Visual Studio Code by pressing `CTRL+SHIFT+P` and typing `Remote-WSL: New WSL Window`. This will bring up a new window. In the new window, choose `open folder` and choose the folder you've created prior. Press OK and now you have your Folder opened as a Workspace!
10. Add code to your CXX file and compile it by running `g++ -std=c++17 *.cxx -o bot -ldpp` in the same folder as your cxx file.
11. start your bot by typing `./bot`!
7. Create a new directory, inside your home directory, using `mkdir MyBot`. Then, you want to open that directory using `cd MyBot`.
8. Now that you've a directory to work in, type `touch mybot.cxx` to create a file you can work in!
9. Now, head on over to Visual Studio Code. Press `CTRL+SHIFT+P` and type `Remote-WSL: New WSL Window` (You don't have to type all of it, it will auto-suggest it!). This will bring up a new window. In the new window, choose `open folder` and choose the directory you've created prior (It should be within your home directory). Press OK and now you have your Folder opened as a Workspace!
10. Add code to your CXX file (We suggest using the \ref firstbot "first bot page" if this is your first time!) and compile it by running `g++ -std=c++17 *.cxx -o bot -ldpp` in the same folder as your cxx file. This will create a "bot" file!
11. You can now start your bot by typing `./bot`!

If everything was done right, you should be able to see your bot working!

0 comments on commit c73ca76

Please sign in to comment.