Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cc86cef
Add C++ modules support and update nlohmann::json
mikomikotaishi Dec 27, 2025
b9e4215
Move module to include/ directory, add compiling example program for …
mikomikotaishi Dec 27, 2025
868782b
Add modules unit test
mikomikotaishi Dec 28, 2025
1d41aa9
Trying specific handling for CMake examples
mikomikotaishi Feb 19, 2026
ce88aff
Manually link the module instead of relying on CMake for now
mikomikotaishi Feb 26, 2026
7defeb8
Merge branch 'dev' into dev
mikomikotaishi May 26, 2026
15dbf83
Merge branch 'dev' into dev
mikomikotaishi Jun 29, 2026
6c828af
Merge branch 'dev' into dev
mikomikotaishi Jul 5, 2026
349c958
Remove now irrelevant attributes
mikomikotaishi Jul 5, 2026
2eb60f1
Remove edits to json.hpp
mikomikotaishi Jul 10, 2026
6d39166
Merge branch 'dev' into dev
mikomikotaishi Jul 10, 2026
531227d
Restore removed `-rdynamic` flag
mikomikotaishi Jul 10, 2026
d887c03
Add a static-linux and install-consumer job on CI
mikomikotaishi Jul 10, 2026
8cf7f90
Merge branch 'dev' into dev
mikomikotaishi Jul 10, 2026
55eadfb
Merge branch 'dev' into dev
mikomikotaishi Jul 10, 2026
d87cb46
Merge branch 'dev' into dev
braindigitalis Jul 10, 2026
b1699de
Merge branch 'dev' into dev
mikomikotaishi Jul 18, 2026
ac09477
Apply recommended docs changes
mikomikotaishi Jul 19, 2026
4a12d0c
Add a CI for building the module on Windows
mikomikotaishi Jul 19, 2026
37a91e0
Merge branch 'dev' into dev
mikomikotaishi Jul 25, 2026
81fdff6
Merge branch 'dev' into dev
mikomikotaishi Aug 9, 2026
294146b
Fix reported issues by maintainers
mikomikotaishi Aug 9, 2026
7e8b739
Explicitly disable GNU extensions
mikomikotaishi Aug 23, 2026
54bcd73
Use ClangCL instead of cl.exe, due to error C2039
mikomikotaishi Aug 23, 2026
fd95cb5
Clarify CMake instructions for modules
mikomikotaishi Aug 24, 2026
4f33bf2
Merge branch 'dev' into dev
Jaskowicz1 Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/test-docs-examples.yml
Comment thread
mikomikotaishi marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
jobs:
test_docs_examples:
name: Test build examples
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -35,17 +35,19 @@ jobs:
submodules: recursive

- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install -y g++-12 libopus-dev zlib1g-dev libmpg123-dev liboggz-dev cmake libfmt-dev libopusfile-dev
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install -y clang-20 libopus-dev ninja-build zlib1g-dev libmpg123-dev liboggz-dev cmake libfmt-dev libopusfile-dev

- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=T_fallback -DDPP_CORO=ON -DCMAKE_BUILD_TYPE=Debug ..
run: mkdir build && cd build && cmake -G Ninja -DDPP_NO_VCPKG=ON -DDPP_MODULES=ON -DAVX_TYPE=T_fallback -DDPP_CORO=ON -DCMAKE_BUILD_TYPE=Debug ..
env:
CXX: g++-12
CXX: clang++-20

- name: Build Project
run: cd build && make -j2 && sudo make install
run: cd build && cmake --build . -j2 && sudo ninja install
env:
CXX: clang++-20

- name: Test compile examples
run: cd docpages/example_code && mkdir build && cd build && cmake .. && make -j2
run: cd docpages/example_code && mkdir build && cd build && cmake -G Ninja -DDPP_MODULES=ON .. && cmake --build . -j2
env:
CXX: g++-12
CXX: clang++-20
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

cmake_minimum_required (VERSION 3.16)
set(CMAKE_CXX_STANDARD 17)

option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_VOICE_SUPPORT "Build voice support" ON)
option(RUN_LDCONFIG "Run ldconfig after installation" ON)
Expand All @@ -33,6 +33,7 @@ option(DPP_USE_EXTERNAL_JSON "Use an external installation of nlohmann::json" OF
option(DPP_USE_PCH "Use precompiled headers to speed up compilation" OFF)
option(AVX_TYPE "Force AVX type for speeding up audio mixing" OFF)
option(DPP_TEST_VCPKG "Force VCPKG build without VCPKG installed (for development use only!)" OFF)
option(DPP_MODULES "Support for C++20 modules (experimental)" OFF)

include(CheckCXXSymbolExists)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -159,3 +160,4 @@ endif()
if (NOT WIN32)
target_link_libraries(dpp PRIVATE std::filesystem)
endif()

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ D++ is a lightweight and efficient library for **Discord** written in **modern C
* Stable [Windows support](https://dpp.dev/buildwindows.html)
* Ready-made compiled packages for Windows, Raspberry Pi (ARM64/ARM7/ARMv6), Debian x86/x64, and RPM based distributions
* Highly scalable for large amounts of guilds and users
* Support for [C++ modules](https://dpp.dev/using_modules.html)
Comment thread
Jaskowicz1 marked this conversation as resolved.
Outdated

Want to help? Drop me a line or send a PR.

Expand Down
44 changes: 32 additions & 12 deletions cmake/CPackSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,40 @@ set(DPP_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}/${DPP_VERSIONED})

## Pack the binary output
if (WIN32)
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${DPP_INSTALL_INCLUDE_DIR})
if (DPP_MODULES)
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${DPP_INSTALL_INCLUDE_DIR}
FILE_SET CXX_MODULES DESTINATION ${DPP_INSTALL_INCLUDE_DIR})
else()
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${DPP_INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${DPP_INSTALL_INCLUDE_DIR})
endif()
install(DIRECTORY "${DPP_ROOT_PATH}/include/" DESTINATION "${DPP_INSTALL_INCLUDE_DIR}")
else()
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBRARY_DIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDE_DIR})
if (DPP_MODULES)
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILE_SET CXX_MODULES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
install(TARGETS dpp
EXPORT ${DPP_EXPORT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
endif()

## Allow for a specific version to be chosen in the `find_package` command
Expand Down
26 changes: 24 additions & 2 deletions docpages/example_code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,41 @@
# libmpg123-dev
# dpp latest master with -DDPP_CORO=ON installed sytemwide

cmake_minimum_required (VERSION 3.16)
cmake_minimum_required (VERSION 3.28)
Comment thread
braindigitalis marked this conversation as resolved.
project(documentation_tests)

include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/colour.cmake")

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -rdynamic -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations")
Comment thread
Jaskowicz1 marked this conversation as resolved.
option(DPP_MODULES "Build examples with C++20 modules support" ON)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")

# Create gcm.cache directory and symlink to the main build's dpp.gcm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I can see that, but why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang obtains the BMI paths through -fprebuilt-module-path which indicates where to scan, but GCC has no such option, and places its BMIs in gcm.cache/, which is why the lookup location is populated with the symlink to the actual interface.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? I've not had to do this with any of my other projects

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/gcm.cache")
file(CREATE_LINK "${CMAKE_SOURCE_DIR}/../../build/library/CMakeFiles/dpp.dir/dpp.gcm"
"${CMAKE_BINARY_DIR}/gcm.cache/dpp.gcm" SYMBOLIC)
endif()

file(GLOB example_list ./*.cpp)
foreach (example ${example_list})
get_filename_component(examplename ${example} NAME)
message(STATUS "Found example '${BoldBlue}${examplename}${ColourReset}'")
add_executable(${examplename}_out ${example})
target_link_libraries(${examplename}_out dl dpp mpg123 oggz ogg opusfile opus)
include_directories(/usr/include/opus)

target_compile_definitions(${examplename}_out PRIVATE DPP_MODULES)
set_target_properties(${examplename}_out PROPERTIES CXX_SCAN_FOR_MODULES ON)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(${examplename}_out PRIVATE -fmodules-ts)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${examplename}_out PRIVATE
-fmodules
-mavx2
Comment thread
Jaskowicz1 marked this conversation as resolved.
Outdated
-fprebuilt-module-path=${CMAKE_SOURCE_DIR}/../../build/library/CMakeFiles/dpp.dir
)
endif()
endforeach(example)
2 changes: 1 addition & 1 deletion docpages/example_code/attachments1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "file") {
dpp::message msg(event.command.channel_id, "Hey there, I've got a new file!");
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/attachments3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "file") {
/* Create a message. */
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/autocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main()
});

/* The interaction create event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t & event) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to change all the examples, it makes the PR much harder to review, so many files to go through.

@mikomikotaishi mikomikotaishi Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved these changes into a separate PR, #1604

bot.on_slashcommand([](const dpp::slashcommand_t & event) {

/* Check which command they ran */
if (event.command.get_command_name() == "blep") {
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/cache_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main() {
});

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot, &message_cache](const dpp::slashcommand_t& event) {
bot.on_slashcommand([&message_cache](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "get") {

Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "button") {
/* Create a message */
Expand All @@ -33,7 +33,7 @@ int main() {
/* When a user clicks your button, the on_button_click event will fire,
* containing the custom_id you defined in your button.
*/
bot.on_button_click([&bot](const dpp::button_click_t& event) {
bot.on_button_click([](const dpp::button_click_t& event) {
/* Button clicks are still interactions, and must be replied to in some form to
* prevent the "this interaction has failed" message from Discord to the user.
*/
Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/components2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "math") {

Expand Down Expand Up @@ -40,7 +40,7 @@ int main() {
}
});

bot.on_button_click([&bot](const dpp::button_click_t & event) {
bot.on_button_click([](const dpp::button_click_t & event) {
if (event.custom_id == "10") {
event.reply(dpp::message("You got it right!").set_flags(dpp::m_ephemeral));
} else {
Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/components3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "select") {
/* Create a message */
Expand All @@ -33,7 +33,7 @@ int main() {
/* When a user clicks your select menu , the on_select_click event will fire,
* containing the custom_id you defined in your select menu.
*/
bot.on_select_click([&bot](const dpp::select_click_t & event) {
bot.on_select_click([](const dpp::select_click_t & event) {
/* Select clicks are still interactions, and must be replied to in some form to
* prevent the "this interaction has failed" message from Discord to the user.
*/
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/components3_rolemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "select") {
/* Create a message */
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/default_select_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "select") {
/* Create a message */
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/detecting_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when the bot detects a message in any server and any channel it has access to. */
bot.on_message_create([&bot](const dpp::message_create_t& event) {
bot.on_message_create([](const dpp::message_create_t& event) {
/* See if the message contains the phrase we want to check for.
* If there's at least a single match, we reply and say it's not allowed.
*/
Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/editing_message_after_click.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "button") {
/* Create a message */
Expand All @@ -33,7 +33,7 @@ int main() {
/* When a user clicks your button, the on_button_click event will fire,
* containing the custom_id you defined in your button.
*/
bot.on_button_click([&bot](const dpp::button_click_t& event) {
bot.on_button_click([](const dpp::button_click_t& event) {
/* Instead of replying to the button click itself,
* we want to update the message that had the buttons on it.
*/
Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/editing_message_after_click2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "button") {
/* Create a message */
Expand All @@ -33,7 +33,7 @@ int main() {
/* When a user clicks your button, the on_button_click event will fire,
* containing the custom_id you defined in your button.
*/
bot.on_button_click([&bot](const dpp::button_click_t& event) {
bot.on_button_click([](const dpp::button_click_t& event) {
/* Instead of replying to the button click itself,
* we want to update the message that had the buttons on it.
*/
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/embeds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "embed") {
/* Create an embed */
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/ephemeral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t & event) {
bot.on_slashcommand([](const dpp::slashcommand_t & event) {
/* Check which command they ran */
if (event.command.get_command_name() == "hello") {
/* Reply to the user, but only let them see the response. */
Expand Down
4 changes: 2 additions & 2 deletions docpages/example_code/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main() {
* This code assumes the current directory is writeable. The file will have a
* unique name made from the user's id and the message id.
*/
std::string source_filename = std::to_string(event.msg.author.id) + "_" + std::to_string(event.msg.id) + ".cpp";
std::string source_filename = std::to_string(event.msg.author.id) + "_" + std::to_string(event.msg.id) + ".cpp";
std::fstream code_file(source_filename, std::fstream::binary | std::fstream::out);
if (!code_file.is_open()) {
bot.message_create(dpp::message(event.msg.channel_id, "Unable to create source file for `eval`"));
Expand All @@ -96,7 +96,7 @@ int main() {
std::to_string(event.msg.author.id) + "_" + std::to_string(event.msg.id) + ".cpp",
"-ldpp",
"-ldl"
}, [event, &bot, source_filename, compile_start](const std::string &output) {
}, [event, &bot, compile_start](const std::string &output) {

/* After g++ is ran we end up inside this lambda with the output as a string */
double compile_time = dpp::utility::time_f() - compile_start;
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/join_voice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {

/* Check which command they ran */
if (event.command.get_command_name() == "join") {
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/modal_dialog_interactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int main() {

bot.on_log(dpp::utility::cout_logger());

bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {
/* Check for our /dialog command */
if (event.command.get_command_name() == "dialog") {
/* Instantiate an interaction_modal_response object */
Expand Down
6 changes: 3 additions & 3 deletions docpages/example_code/mp3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ int main() {
mpg123_open(mh, MUSIC_FILE);
mpg123_getformat(mh, &rate, &channels, &encoding);

unsigned int counter = 0;
for (int totalBytes = 0; mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK; ) {
[[maybe_unused]] unsigned int counter = 0;
for ([[maybe_unused]] int totalBytes = 0; mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK; ) {
for (size_t i = 0; i < buffer_size; i++) {
pcmdata.push_back(buffer[i]);
}
Expand All @@ -59,7 +59,7 @@ int main() {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot, &pcmdata](const dpp::slashcommand_t& event) {
bot.on_slashcommand([&pcmdata](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "join") {
/* Get the guild */
Expand Down
2 changes: 1 addition & 1 deletion docpages/example_code/oggopus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main(int argc, char const *argv[]) {
bot.on_log(dpp::utility::cout_logger());

/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
bot.on_slashcommand([](const dpp::slashcommand_t& event) {

/* Check which command they ran */
if (event.command.get_command_name() == "join") {
Expand Down
Loading
Loading