Skip to content

Commit

Permalink
not sure where these docs changes came from
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 4, 2024
1 parent b73d0d1 commit c4899a2
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion buildtools/make_vcpkg.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$vcpkg->constructPortAndVersionFile()
);
if (!empty($sha512)) {
/* now check out master */
/* Now check out master */
if (!$vcpkg->checkoutRepository()) {
exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion docpages/advanced_reference/automating-with-jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Making sure you have your project files in the workspace directory (you can see

Running the builds is the same as any other time, but we'll still cover it! However, we won't cover running it in background and whatnot, that part is completely down to you.

First, you need to get into the `jenkins` user. If you're like me and don't have the Jenkins user password, you can login with your normal login (that has sudo perms) and do `sudo su - jenkins`. Once logged in, you'll be in `/var/lib/jenkins/`. From here, you'll want to do `cd workspace/DiscordBot/` (make sure to replace "DiscordBot" with your bot's name. Remember, you can tab-complete this) and then `cd build`. now, you can simply do `./DiscordBot`!
First, you need to get into the `jenkins` user. If you're like me and don't have the Jenkins user password, you can login with your normal login (that has sudo perms) and do `sudo su - jenkins`. Once logged in, you'll be in `/var/lib/jenkins/`. From here, you'll want to do `cd workspace/DiscordBot/` (make sure to replace "DiscordBot" with your bot's name. Remember, you can tab-complete this) and then `cd build`. Now, you can simply do `./DiscordBot`!

\warning If you are going to be running the bot at the same time as builds, I would heavily advise that you copy the bot (if it's not statically linked, then copy the entire build directory) to a different location. This is so you can pick and choose when the bot gets updated (and even means you can run experimental builds as opposed to stable builds) but also means you avoid any risk of the bot crashing during build (as Jenkins will be overwriting your executable and libraries).

Expand Down
2 changes: 1 addition & 1 deletion docpages/advanced_reference/lambdas_and_locals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is important to remember that when you put a lambda callback onto a function

To explain this situation and how it causes issues, I'd like you to imagine the age-old magic trick, where a magician sets a fine table full of cutlery, pots, pans and wine. He indicates to the audience that this is authentic, then with a whip of his wrist, he whips the tablecloth away, leaving the cutlery and other tableware in place (if he is any good as a magician!)

now imagine the following code scenario. We will describe this code scenario as the magic trick above, in the steps below:
Now imagine the following code scenario. We will describe this code scenario as the magic trick above, in the steps below:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cpp
bot.on_message_create([&bot](const dpp::message_create_t & event) {
Expand Down
2 changes: 1 addition & 1 deletion docpages/advanced_reference/separate-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ int main() {

And there we go! How tidy is that?

now, the possibilities to this are not limited. If you wish to do this twice (as I explained at first), you can simply have another class and just copy the `bot.on_message_create` line below in the `main.cpp` file and then you can change it to reference the second class, meaning you have two message events firing in two separate classes!
Now, the possibilities to this are not limited. If you wish to do this twice (as I explained at first), you can simply have another class and just copy the `bot.on_message_create` line below in the `main.cpp` file and then you can change it to reference the second class, meaning you have two message events firing in two separate classes!
2 changes: 1 addition & 1 deletion docpages/example_programs/misc/making_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ After that, you'll be able to see your bot send a message in your thread!

Those of you who are familar with sending messages in regular channels may have also noticed that sending messages to threads is the same as sending a general message. This is because threads are basically channels with a couple more features!

now, we're going to cover how to lock a thread! With this, you'll also learn how to edit threads in general, meaning you can go forward and learn how to change even more stuff about threads, as much as your heart desires!
Now, we're going to cover how to lock a thread! With this, you'll also learn how to edit threads in general, meaning you can go forward and learn how to change even more stuff about threads, as much as your heart desires!

\include{cpp} making_threads3.cpp

Expand Down
2 changes: 1 addition & 1 deletion docpages/example_programs/misc/setting_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If all went well, your bot should now be online and say this on members list!
If you want to make your bot show as Do Not Disturb, then you could change dpp::ps_online to dpp::ps_dnd.
You can also play around with dpp::at_game, changing it to something like dpp::at_custom or dpp::at_listening!

now, let's cover setting the bot status to say `Playing with x guilds!` every two minutes.
Now, let's cover setting the bot status to say `Playing with x guilds!` every two minutes.

\note This example uses timers to update the status every 2 minutes. If you aren't familiar with D++'s own timers, please read \ref using_timers "this page on timers" before you continue.

Expand Down
2 changes: 1 addition & 1 deletion docpages/example_programs/misc/using-emojis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ First - Sending emojis. You have to use its mention, which depends on the type.

\include{cpp} using_emojis1.cpp

now, our bot will send our epic emojis!
Now, our bot will send our epic emojis!

\image html using_emojis1.png

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ After editing the channel:
\image html stuff_edit4.png

## Editing embeds
now let's send an embed and edit it. If a message has one `content` field, it can have a few `embed` fields, up to 10 to be precise. So we first get the embed we want and edit and change its description.
Now let's send an embed and edit it. If a message has one `content` field, it can have a few `embed` fields, up to 10 to be precise. So we first get the embed we want and edit and change its description.

\include{cpp} editing_messages3.cpp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\page callback-functions Using Callback Functions

When you create or get an object from Discord, you send the request to its API and in return you get either an error or the object you requested/created. You can pass a function to API calls as the callback function. This means that when the request completes, and you get a response from the API, your callback function executes. You must be careful with lambda captures! Good practice would be not capturing variables by reference unless you have to, since when the request completes and the function executes, the variables can already be destructed. Advanced reference can be found [here](https://dpp.dev/lambdas-and-locals.html). now, let's see callback functions in action:
When you create or get an object from Discord, you send the request to its API and in return you get either an error or the object you requested/created. You can pass a function to API calls as the callback function. This means that when the request completes, and you get a response from the API, your callback function executes. You must be careful with lambda captures! Good practice would be not capturing variables by reference unless you have to, since when the request completes and the function executes, the variables can already be destructed. Advanced reference can be found [here](https://dpp.dev/lambdas-and-locals.html). Now, let's see callback functions in action:

\include{cpp} callbacks.cpp

Expand Down
2 changes: 1 addition & 1 deletion docpages/install/install-windows-vs-zip.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To add D++ to a Visual Studio project, using **Visual Studio 2019** or **Visual
12. Again within the same window, go to the input section, under the linker category, and add '**dpp.lib;**' to the start of the libraries to include, as shown below:
\image html zip_vsproj_11.png

13. now you can paste some code into the editor, completely replacing the 'hello world' application that Visual Studio made for you. The example code here is the basic bot from the first example on this site. You should at this point also double check that the architecture you have selected (in this case x86) matches the version of the dll/lib files you downloaded from the website. This is **important** as if you mismatch them the compilation will just fail.
13. Now you can paste some code into the editor, completely replacing the 'hello world' application that Visual Studio made for you. The example code here is the basic bot from the first example on this site. You should at this point also double check that the architecture you have selected (in this case x86) matches the version of the dll/lib files you downloaded from the website. This is **important** as if you mismatch them the compilation will just fail.
\image html zip_vsproj_12.png

14. Go to the build menu and choose Build Solution (A handy shortcut for this is to just press **F7**):
Expand Down
2 changes: 1 addition & 1 deletion docpages/make_a_bot/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ find_package_handle_standard_args(DPP DEFAULT_MSG DPP_LIBRARIES DPP_INCLUDE_DIR)

## 4. Build the bot.

now that we have our all our cmake stuff setup and we've got our code in place, we can initalise CMake. You'll want to go inside the `build/` directory and do `cmake ..`.
Now that we have our all our cmake stuff setup and we've got our code in place, we can initalise CMake. You'll want to go inside the `build/` directory and do `cmake ..`.

Once that's completed, you'll want to head back to your up-most folder (where all the folders are for your bot) and run `cmake --build build/ -j4` (replace -j4 with however many threads you want to use). This will start compiling your bot and creating the executable.

Expand Down
2 changes: 1 addition & 1 deletion docpages/make_a_bot/meson.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ meson setup builddir
meson compile -C builddir
```

now, your Meson project should be all setup!
Now, your Meson project should be all setup!

**Have fun!**
2 changes: 1 addition & 1 deletion docpages/make_a_bot/replit.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ g++ -o bot main.cpp -ldpp -lpthread -L./usr/lib -I./usr/include -std=c++17
LD_PRELOAD=./usr/lib/libdpp.so ./bot
```

now that your bot is running, you have to keep it online. Replit automatically puts repls to sleep after some time, so you will need to ping a webserver. Unfortunately, Replit is sometimes limiting, and this is one of the only free workarounds to this issue.
Now that your bot is running, you have to keep it online. Replit automatically puts repls to sleep after some time, so you will need to ping a webserver. Unfortunately, Replit is sometimes limiting, and this is one of the only free workarounds to this issue.

1. Start a http server. This can be through any webserver, but as a simple solution, use python's built in http.server:
```bash
Expand Down
2 changes: 1 addition & 1 deletion docpages/make_a_bot/windows_wsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This tutorial teaches you how to create a lightweight environment for D++ develo
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. 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!
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`!

Expand Down
2 changes: 1 addition & 1 deletion doxygen-awesome-css

0 comments on commit c4899a2

Please sign in to comment.