diff --git a/advanced-reference.js b/advanced-reference.js index 08a4d6868c3..1bba746da9f 100644 --- a/advanced-reference.js +++ b/advanced-reference.js @@ -3,8 +3,8 @@ var advanced_reference = [ "Clusters, Shards, and Guilds", "clusters-shards-guilds.html", null ], [ "Thread Model", "thread-model.html", null ], [ "Voice Model", "voice-model.html", [ - [ "High Level Summary", "voice-model.html#autotoc_md85", null ], - [ "Flow Diagram", "voice-model.html#autotoc_md86", null ] + [ "High Level Summary", "voice-model.html#autotoc_md84", null ], + [ "Flow Diagram", "voice-model.html#autotoc_md85", null ] ] ], [ "Coding Style Standards", "coding-standards.html", null ], [ "Documentation Style Standards", "docs-standards.html", null ], diff --git a/audioframe.svg b/audioframe.svg index 302f65b0db1..b17e104c498 100755 --- a/audioframe.svg +++ b/audioframe.svg @@ -173,7 +173,7 @@ sodipodi:role="line" id="tspan3010" x="748.91284" - y="835.92316">DAVE (AES 128 GCM AEAD) + y="835.92316">DAVE OPUS AUDIO (AES 128 GCM AEAD) SODIUM (CHACHA20 POLY1305) + y="912.60059">RTP CONTENT (CHACHA20 POLY1305 AEAD)
Note
This page does NOT go into explaining how to install Jenkins, nor how to initially setup Jenkins. This is a tutorial for the CMake version with Linux (more specifically Ubuntu 22.04 LTS). If you don't know how to use CMake or you don't use CMake for your bot (and would like to) then please visit Building a Discord Bot Using CMake (UNIX). If you wish to automate this tutorial from GitHub pushes then you can simply download the GitHub plugin for Jenkins, set that up and this tutorial will still work as this tutorial will only build what it can see!
-

+

Getting started

First of all, you'll want to create your project. For this, we'll use a "Freestyle project" as we're just going to be calling some bash commands to tell CMake to build. We'll be calling this "DiscordBot" but you can name it whatever you want. I would advise against non-ASCII characters.

From here, just hit Ok and now you've created your Jenkins project, Well done! From here you can add a description, change the security policy (if your Jenkins is public), really whatever your heart desires.

-

+

Automating the Building Process

Scrolling down, you'll find Build Steps. You can also click Build Steps on the left. Here, you'll want to hit Add build step and hit Execute shell.

@@ -130,20 +130,20 @@

Now you can hit save!

-

+

Seeing the Builds Work

Making sure you have your project files in the workspace directory (you can see this by pressing Workspace on the left, the files will automatically be pulled from GitHub if you're using the GitHub plugin), you should be able to hit Build Now and see a new build in the History appear. If everything went well, you should have a green tick!

Note
Building can take a while if you haven't set up your build directory before (doing cmake ..), especially on less-powerful machines, so don't be alarmed!
-

+

Running the Build

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!

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).

Once you're happy with everything, then you're good to go! Enjoy your automated builds!

-

+

Possible Permission Issues

Sometimes, doing ./DiscordBot can end up with an error, saying you don't have permission to execute. If that's the case, simply do chmod +x DiscordBot and now you can re-run ./DiscordBot.

diff --git a/build-a-bot-xcode.html b/build-a-bot-xcode.html index e29b180643b..dc630812cc5 100644 --- a/build-a-bot-xcode.html +++ b/build-a-bot-xcode.html @@ -120,7 +120,7 @@ -

+

Troubleshooting

@@ -186,7 +185,7 @@

All functions within D++ are multi-threaded. You should still avoid doing long operations within event handlers or within callbacks, to prevent starvation of the threads managing each shard. Various blocking operations such as running files and making HTTP requests are offered as library functions (for example dpp::utility::exec).

Does this library support voice?

-

Yes! This library supports voice and will automatically enable voice if your system has the libopus and libsodium libraries. When running cmake the script will identify if these libraries are found. See the example programs for information on how to send audio.

+

Yes! This library supports voice and will automatically enable voice if your system has the libopus library. When running cmake the script will identify if this library is found. See the example programs for information on how to send audio.

Does this library support sharding?

Yes! D++ supports sharding and also clustering (grouping of shards into one process) to ensure it is scalable for small and large bots alike.

@@ -206,15 +205,12 @@

When I start my bot I get an error: "error while loading shared libraries: libdpp.so: cannot open shared object file: No such file or directory"

To fix this issue, run ldconfig: sudo ldconfig as root. Log out if your SSH session and log back in, and the bot should be able to find the library.

-When compiling with voice support, I get an error: "No rule to make target 'sodium_LIBRARY_DEBUG-NOTFOUND', needed by 'libdpp.so'. Stop."

-

The libsodium package requires pkg-config, but does not check for it when installed. Install it as root, e.g. sudo apt install pkg-config. Rerun cmake, and rebuild the library.

-

When I try to instantiate a dpp::cluster in windows, I get "D++ Debug/Release mismatch"

If this happens, ensure you are using the correct precompiled build of the library. Our precompiled binaries are built in two forms, release mode and debug mode for Visual Studio 2019/2022. These two versions of the library are not cross-compatible due to differences in the debug and release STL (Microsoft standard library implementation). You should not need to build your own copy, but please see the section about Building on Windows for more information on how to build your own copy, if needed.

-

+

Does this library build/run on Raspberry Pi?

Yes! This project will build and run on Raspberry Pi and is very much suited to this kind of system. It may take some time (read: hours) to compile the project on your Raspberry Pi unless you build it using a cross compiler. We offer pre-built .deb files for arm6, arm7 and arm64, you should use these where possible to avoid having to compile it by hand, or you can use a cross-compiler to build it on your PC then transfer the compiled binaries across.

-

+

There are so many versions! Which deb file do I need for my Raspberry Pi?

Depending on which Raspberry Pi version you have, you will need to download a different release binary:

@@ -228,19 +224,19 @@

Raspberry Pi 4 with 64 Bit Linuxlibdpp-x.x.x-linux-rpi-arm64.debARM64
-

+

Are other ARM devices supported?

Yes! We have confirmed that the D++ deb file will successfully install and operate on various forms of cellphone or non-pi ARM devices. If you get it working on any other devices please let us know, and we can build a compatibility chart.

-

+

Can I run a D++ bot in Replit?

No. We used to support it (and still have our page about it which you can find here), however, Replit does not have up-to-date packages, meaning D++ can no longer run. We've attempted to reach out to ask about this but we've had no luck.

-

+

Why do the "get" functions like "messages_get" return void rather than what I'm after?

All the functions that obtain data directly from Discord (as opposed to the cache) perform HTTPS requests and may have to wait, either for the request itself or for their turn in a queue to respect rate limits. As such, it does not make sense that they should return a value, as this would mean they block execution of your event. Instead, each has a lambda, a function handler which receives the result of the request, which you can then read from within that function to get the data you are interested in. Note that this result will arrive on a different thread to the one which made the request. If you instead want the function to return a value, you can enable coroutines and use for example co_await cluster->co_message_get(...) to retrieve the result in your function.

-

+

Can I use a user token with this library (as opposed to a bot token)?

No. This feature is not supported as it is against the Discord Terms Of Service, and therefore we have no plans to ever support it. You should not automate any user token. Some libraries used to support this, but it is a legacy feature of those libraries (where still available) dating back to before Discord offered an official public API. Please be aware that if Discord ever catch you automating a user token (or making a user client that uses a bot token) they can and do ban people for this.

-

+

What are nightly builds?

These are automatic builds that happen every night without any human supervision. They allow you to try the latest state of the library without having to build it yourself, but they come without any guarantees.

diff --git a/functions_s.html b/functions_s.html index 5734ef9e9ba..1814acf04f3 100644 --- a/functions_s.html +++ b/functions_s.html @@ -176,7 +176,7 @@

- s -