Skip to content

Commit

Permalink
automatic commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Docs Deployment Bot committed Oct 14, 2024
1 parent 281ccde commit 2616a2e
Show file tree
Hide file tree
Showing 158 changed files with 3,718 additions and 3,375 deletions.
4 changes: 2 additions & 2 deletions advanced-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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_md84", null ],
[ "Flow Diagram", "voice-model.html#autotoc_md85", null ]
[ "High Level Summary", "voice-model.html#autotoc_md87", null ],
[ "Flow Diagram", "voice-model.html#autotoc_md88", null ]
] ],
[ "Coding Style Standards", "coding-standards.html", null ],
[ "Documentation Style Standards", "docs-standards.html", null ],
Expand Down
2 changes: 1 addition & 1 deletion build-a-bot-xcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</div>
</li>
</ol>
<h2><a class="anchor" id="autotoc_md173"></a>
<h2><a class="anchor" id="autotoc_md176"></a>
Troubleshooting</h2>
<ul>
<li>Stuck? You can find us on the <a href="https://discord.gg/dpp">official Discord server</a> - ask away! We don't bite! </li>
Expand Down
2 changes: 1 addition & 1 deletion build-a-discord-bot-linux-clion.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section warning"><dt>Warning</dt><dd><b>This tutorial assumes you are using Ubuntu</b>. You might use other distros if you prefer, but keep in mind the setup process might be different! This tutorial also teaches you how to use DPP with CMake, using the JetBrains IDE <b><a href="https://www.jetbrains.com/clion/">CLion</a></b>. If you have not installed CLion, You can <a href="https://www.jetbrains.com/de-de/clion/download/">download CLion here</a>. If you do not have DPP installed, visit <a class="el" href="buildcmake.html">this page</a> on how to setup the project using a precompiled version of DPP. If you want to use source and haven't set that up, look towards <a class="el" href="buildlinux.html">this page</a> on how to do so. <b>This tutorial will not teach you how to setup CMake and will assume you have already done so</b>.</dd></dl>
<h3><a class="anchor" id="autotoc_md153"></a>
<h3><a class="anchor" id="autotoc_md156"></a>
Add an example program</h3>
<p >Open up CLion and open the folder for your bot. You may notice that CLion will start doing the whole CMake process and it will create a folder called <code>cmake-build-debug</code>, this is normal so don't be alarmed! It is just CLion registering all the CMake stuff so it can build and give you auto-suggestions.</p>
<p >Now, you can open your <code>main.cpp</code> file. If you have code there, then you're one step ahead! If not, copy and paste the following <a class="el" href="firstbot.html">example program</a> in the <code>main.cpp</code> and set your bot token (see <a class="el" href="creating-a-bot-application.html">Creating a Bot Token</a>). Here's how your <code>main.cpp</code> file should look:</p>
Expand Down
6 changes: 3 additions & 3 deletions build-a-discord-bot-windows-visual-studio.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@
<div class="contents">
<div class="textblock"><p >To create a basic bot using <b>Visual Studio 2019</b> or <b>Visual Studio 2022</b>, follow the steps below to create a <em>working skeleton project you can build upon</em>.</p>
<p >If you prefer a video tutorial, you can watch the video below! Otherwise, scroll past and keep reading!</p>
<h2><a class="anchor" id="autotoc_md170"></a>
<h2><a class="anchor" id="autotoc_md173"></a>
Video Tutorial</h2>
<p >

<iframe width="560" height="315" src="https://www.youtube.com/embed/JGqaQ9nH5sk?si=dung8KuYbWvP2_oL" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

</p>
<h2><a class="anchor" id="autotoc_md171"></a>
<h2><a class="anchor" id="autotoc_md174"></a>
Text Tutorial</h2>
<ol type="1">
<li>Make sure you have Visual Studio 2019 or 2022. Community, Professional or Enterprise work fine. These instructions are not for Visual Studio Code. You can <a href="https://visualstudio.microsoft.com/downloads/">download the correct version here</a>. Note that older versions of Visual Studio will not work as they do not support enough of the C++17 standard.</li>
Expand All @@ -132,7 +132,7 @@ <h2><a class="anchor" id="autotoc_md171"></a>
</div>
</li>
</ol>
<h2><a class="anchor" id="autotoc_md172"></a>
<h2><a class="anchor" id="autotoc_md175"></a>
Troubleshooting</h2>
<ul>
<li>If you get an error that looks like this: <div class="fragment"><div class="line"> 1&gt;MyBot.obj : error LNK2019: unresolved external symbol &quot;__declspec(dllimport) public: class dpp::async&lt;struct dpp::confirmation_callback_t&gt;</div>
Expand Down
8 changes: 4 additions & 4 deletions buildcmake.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section warning"><dt>Warning</dt><dd><b>This tutorial will assume that you have already installed DPP.</b> If you haven't, please head over to <a class="el" href="install-linux-deb.html">this page</a>, or any install page that matches your OS. If you want to use source, then continue your journey over at <a class="el" href="buildlinux.html">this page</a> for a full explanation into using CMake with source.</dd></dl>
<h2><a class="anchor" id="autotoc_md158"></a>
<h2><a class="anchor" id="autotoc_md161"></a>
1. Toolchain</h2>
<p >Before continuing, you will need to install <code>cmake</code> on your system. To be sure that <code>cmake</code> is installed, you can type the following command:</p>
<div class="fragment"><div class="line">$ cmake --version</div>
<div class="line">cmake version 3.22.1</div>
</div><!-- fragment --><p >If your CMake version is not as shown above then don't worry! You can still follow along, even if you're ahead or behind!</p>
<h2><a class="anchor" id="autotoc_md159"></a>
<h2><a class="anchor" id="autotoc_md162"></a>
2. Create a CMake project</h2>
<p >In an empty directory, create the following files and directories:</p>
<div class="dotgraph">
<iframe scrolling="no" frameborder="0" src="dot_inline_dotgraph_4.svg" width="839" height="368"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<h2><a class="anchor" id="autotoc_md160"></a>
<h2><a class="anchor" id="autotoc_md163"></a>
3. Configure CMake</h2>
<p >You'll need to modify the <code>CMakeLists.txt</code> to tell CMake what it's looking for, and other information.</p>
<p >Here is an example CMake configuration, you can adapt it according to your needs:</p>
Expand Down Expand Up @@ -156,7 +156,7 @@ <h2><a class="anchor" id="autotoc_md160"></a>
<div class="line">include(FindPackageHandleStandardArgs)</div>
<div class="line"> </div>
<div class="line">find_package_handle_standard_args(DPP DEFAULT_MSG DPP_LIBRARIES DPP_INCLUDE_DIR)</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md161"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md164"></a>
4. Build the bot.</h2>
<p >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 <code>build/</code> directory and do <code>cmake ..</code>.</p>
<p >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 <code>cmake --build build/ -j4</code> (replace -j4 with however many threads you want to use). This will start compiling your bot and creating the executable.</p>
Expand Down
12 changes: 6 additions & 6 deletions buildfreebsd.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,30 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section note"><dt>Note</dt><dd>This page assumes you are the root user. If you are not, start the package install commands with <code>sudo</code>, along with <code>make install</code>. You will need <code>sudo</code> installed if you are not the root user.</dd></dl>
<h2><a class="anchor" id="autotoc_md86"></a>
<h2><a class="anchor" id="autotoc_md89"></a>
1. Toolchain</h2>
<p >Since the project uses <code>CMake</code>, you'll need to install it! If you don't have it, you can do the following:</p>
<div class="fragment"><div class="line">pkg install cmake</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md87"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md90"></a>
2. Install Voice Dependencies (Optional)</h2>
<p >If you wish to use voice support, you'll need to install opus:</p>
<div class="fragment"><div class="line">cd /usr/ports/audio/opus</div>
<div class="line">make &amp;&amp; make install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md88"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md91"></a>
3. Build Source Code</h2>
<div class="fragment"><div class="line">cmake -B ./build</div>
<div class="line">cmake --build ./build -j8</div>
</div><!-- fragment --><p >Replace the number after <code>-j</code> with a number suitable for your setup, usually the same as the number of cores on your machine. <code>cmake</code> will fetch any dependencies that are required for you and ensure they are compiled alongside the library.</p>
<h2><a class="anchor" id="autotoc_md89"></a>
<h2><a class="anchor" id="autotoc_md92"></a>
4. Install Globally</h2>
<div class="fragment"><div class="line">cd build</div>
<div class="line">make install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md90"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md93"></a>
5. Installation to a Different Directory (Optional)</h2>
<p >If you want to install the library, its dependencies and header files to a different directory, specify this directory when running <code>cmake</code>:</p>
<div class="fragment"><div class="line">cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install</div>
</div><!-- fragment --><p >Then once the build is complete, run <code>sudo make install</code> to install to the location you specified.</p>
<h2><a class="anchor" id="autotoc_md91"></a>
<h2><a class="anchor" id="autotoc_md94"></a>
6. Using the Library</h2>
<p >Once installed, you can make use of the library in standalone programs simply by including it and linking to it:</p>
<div class="fragment"><div class="line">clang++ -std=c++17 -L/usr/local/lib -I/usr/local/include -ldpp bot.cpp -o dppbot</div>
Expand Down
2 changes: 1 addition & 1 deletion building-a-cpp-discord-bot-in-repl.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<div class="image">
<img src="uptimerobot.png" alt=""/>
</div>
<h2><a class="anchor" id="autotoc_md166"></a>
<h2><a class="anchor" id="autotoc_md169"></a>
Troubleshooting</h2>
<ul>
<li>If the bot fails to start and instead you receive an error message about being banned from the Discord API, there is little to be done about this. These bans are temporary but because Replit is a shared platform, you share an IP address with many thousands of bots, some abusive and some badly written. This will happen often and is outside of the control of yourself and us. However, you can try to mitigate this by typing <code>kill 1</code> in the shell. This is not guaranteed to work, and you might need to try it a few times. If it still does not work, then we recommend you obtain some affordable non-free hosting instead.</li>
Expand Down
8 changes: 4 additions & 4 deletions buildlinux.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section note"><dt>Note</dt><dd>You might not need to build a copy of the library for Linux - precompiled deb files for 64 bit and 32 bit Debian and Ubuntu are provided in the GitHub version releases. Unless you are on a different Linux distribution which does not support the installation of deb files, or wish to submit fixes and enhancements to the library itself you should have an easier time installing the precompiled version instead.</dd></dl>
<h2><a class="anchor" id="autotoc_md92"></a>
<h2><a class="anchor" id="autotoc_md95"></a>
1. Build Source Code</h2>
<div class="fragment"><div class="line">cmake -B ./build</div>
<div class="line">cmake --build ./build -j8</div>
</div><!-- fragment --><p >Replace the number after <code>-j</code> with a number suitable for your setup, usually the same as the number of cores on your machine. <code>cmake</code> will fetch any dependencies that are required for you and ensure they are compiled alongside the library.</p>
<h2><a class="anchor" id="autotoc_md93"></a>
<h2><a class="anchor" id="autotoc_md96"></a>
2. Install to /usr/local/include and /usr/local/lib</h2>
<div class="fragment"><div class="line">cd build</div>
<div class="line">sudo make install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md94"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md97"></a>
3. Installation to a Different Directory</h2>
<p >If you want to install the library, its dependencies, and header files to a different directory, specify this directory when running <code>cmake</code>:</p>
<div class="fragment"><div class="line">cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install</div>
</div><!-- fragment --><p >Then once the build is complete, run <code>make install</code> to install to the location you specified.</p>
<h2><a class="anchor" id="autotoc_md95"></a>
<h2><a class="anchor" id="autotoc_md98"></a>
4. Using the Library</h2>
<p >Once installed to the <code>/usr/local</code> directory, you can make use of the library in standalone programs simply by including it and linking to it:</p>
<div class="fragment"><div class="line">g++ -std=c++17 mydppbot.cpp -o dppbot -ldpp</div>
Expand Down
8 changes: 4 additions & 4 deletions buildmeson.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@
<div class="headertitle"><div class="title">Build a Discord Bot Using Meson </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="autotoc_md162"></a>
<div class="textblock"><h2><a class="anchor" id="autotoc_md165"></a>
1. Toolchain</h2>
<p >Before compiling, you will need to install <code>meson</code> on your system. To be sure that <code>meson</code> is installed, you can type the following command:</p>
<div class="fragment"><div class="line">meson --version</div>
<div class="line">0.63.2</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md163"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md166"></a>
2. Create a Meson project</h2>
<p >First, you'll need to go ahead and create an empty directory, we'll call it <code>meson-project</code>.</p>
<p >Then, run this command:</p>
<div class="fragment"><div class="line">meson init -l cpp</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md164"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md167"></a>
3. Configuring Your Meson Project</h2>
<p >Add the following line after the <code>project()</code> line in your <code>meson.build</code> file.</p>
<div class="fragment"><div class="line">dpp = dependency(&#39;dpp&#39;)</div>
Expand All @@ -130,7 +130,7 @@
<div class="line"> </div>
<div class="line">test(&#39;basic&#39;, exe)</div>
</div><!-- fragment --><p >Meson automatically generates a cpp for your project. And a test suite.</p>
<h2><a class="anchor" id="autotoc_md165"></a>
<h2><a class="anchor" id="autotoc_md168"></a>
4. Building</h2>
<p >To build a Meson project, run the following:</p>
<div class="fragment"><div class="line">meson setup builddir</div>
Expand Down
12 changes: 6 additions & 6 deletions buildopenbsd.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,28 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><dl class="section note"><dt>Note</dt><dd>This page assumes you are the root user. If you are not, start the package install commands with <code>doas</code>, along with <code>make install</code>.</dd></dl>
<h2><a class="anchor" id="autotoc_md96"></a>
<h2><a class="anchor" id="autotoc_md99"></a>
1. Toolchain</h2>
<p >Since the project uses <code>CMake</code>, you'll need to install it! If you don't have it, you can do the following:</p>
<div class="fragment"><div class="line">pkg_add cmake</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md97"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md100"></a>
2. Install Voice Dependencies (Optional)</h2>
<p >If you wish to use voice support, you'll need to do the following:</p>
<div class="fragment"><div class="line">pkg_add opus</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md98"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md101"></a>
3. Build Source Code</h2>
<div class="fragment"><div class="line">cmake -B ./build</div>
<div class="line">cmake --build ./build -j8</div>
</div><!-- fragment --><p >Replace the number after <code>-j</code> with a number suitable for your setup, usually the same as the number of cores on your machine. <code>cmake</code> will fetch any dependencies that are required for you and ensure they are compiled alongside the library.</p>
<h2><a class="anchor" id="autotoc_md99"></a>
<h2><a class="anchor" id="autotoc_md102"></a>
4. Install Globally</h2>
<div class="fragment"><div class="line">cd build; make install</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md100"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md103"></a>
5. Installation to a Different Directory</h2>
<p >If you want to install the library, its dependencies and header files to a different directory, specify this directory when running <code>cmake</code>:</p>
<div class="fragment"><div class="line">cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install</div>
</div><!-- fragment --><p >Then once the build is complete, run <code>make install</code> to install to the location you specified.</p>
<h2><a class="anchor" id="autotoc_md101"></a>
<h2><a class="anchor" id="autotoc_md104"></a>
6. Using the Library</h2>
<p >Once installed to the <code>/usr/local</code> directory, you can make use of the library in CMake, without linking to a folder! You can't use this with <code>clang++</code>, nor <code>g++</code>, as OpenBSD seems to be broken on this end, so your only option from here is to use CMake. This isn't a bad thing, as we recommend people to use CMake anyways!</p>
<p ><b>Have fun!</b> </p>
Expand Down
Loading

0 comments on commit 2616a2e

Please sign in to comment.