DPP

C++ Discord API Bot Library - D++ is Lightweight and scalable for small and huge bots!

APACHE-2.0 License

Downloads
56
Stars
943

Bot releases are hidden (Show)

DPP - v9.0.9 release

Published by braindigitalis almost 3 years ago

We are happy to announce the release of version 9.0.9 of D++! The 9.0.9 release has some major new features bundled within it. The main features of this release are:

  • D++ now has full support for ETF websocket protocol (a binary protocol which is much faster and simpler than JSON to parse). This is easy to turn on by calling cluster::set_websocket_protocol before cluster::start
  • Added proper support for stage instances (events and REST calls)
  • Add audit log reasons to all REST calls that support it, via cluster::add_audit_reason
  • Support for building in MINGW (no voice support yet)

The full changelog of D++ 9.0.9 is listed below:

Release Changelog

✨ New Features

  • full support for ETF websocket protocol
  • Support for building in MINGW (no voice support yet)
  • Support for stage instances
  • Add audit log reasons via cluster::add_audit_reason()

💣 Breaking Changes

  • Structure format for stage instances has changed

♻️ Refactoring

  • remove socket notifier as its reason for existing is not needed any more. Replace with much simpler std::condition_variables
  • Improve performance in main parse loop by avoiding double find()
  • Improve performance of low level buffer parse in wsclient

🐞 Bug Fixes

  • Fix: silenced EMBEDDED_ACTIVITY_UPDATE, no docs on this yet
  • Improved thread support
  • fix 404 in invite_get method
  • fix message_delete_bulk function

👷 CI/Build

  • Enable parallel builds on GH Actions
  • build: splitting up of cluster into multiple files each with a subsystem within

📚 Documentation

  • document support for mingw
  • fixed typo in doc
  • fix exec example
  • mention ETF as a killer feature in readme/docs index
  • Fixes by misspell-fixer
  • call the timestamp setter in the embed example instead of assigning the value directly

Thanks for using D++!

DPP - v9.0.8 release

Published by braindigitalis about 3 years ago

Version 9.0.8 of D++ is finally here, with a whole load of new features and fixes for use in your projects! This is a recommended upgrade as it fixes a lot of issues, some related to receiving voice which was introduced as a feature in 9.0.7.

The full changelog of D++ 9.0.8 is listed below:

Release Changelog

✨ New Features

  • feat: #121 - set_timestamp() for dpp::embed objects
  • feat: specialised from_string for plain integer types like snowflake
  • add support for animated guild banners (experiment). add comments where missing to other headers
  • Add optional channel_types in dpp::command_option
  • Added SOCKET_ERROR and INVALID_SOCKET defines if they dont exis
  • Updated WantWrite to use INVALID_SOCKET
  • Added dpp::socket typedef to handle different socket types for windows/other
  • updated socket related code to use dpp::socket
  • add support for webhook icon that is already base64 encoded
  • Change CoreExport macro to be DPP_EXPORT

🐞 Bug Fixes

  • fix: discord_voice_client::log not declared const, shadows parent
  • fix guild_get_member bug, incorrectly named endpoint
  • fix: getaddrinfo hints in sslclient
  • fix: thread_member_update event never initialised member information
  • fix: thread metadata not initialised on reading thread JSON from event
  • fix: not able to remove components on message edit
  • Change addrLen to socklen_t for cross platform compatability
  • Replace random number generator for port selection, replacing with 0 to let kernel pick port
  • Removed no longer used in_queue_port and out_queue_port variables.
  • explicit u8 on the start of emoji string literals to make this more portable to C++20 and other charsets
  • removed unused str_length from string_has_prefix
  • emoji_flags set to uint8_t
  • binary operators used on signed type role_flags set to uint8_t
  • binary operators used on signed type cluster constructor exception formal parameter removed as its unused lots of type conversions
  • forward declarations removed from commandhandler.cpp
  • add win32_safe_warnings.h pragma squasher
  • Fix warnings in commandhandler.h
  • fix: check if voice_client_speaking is attached before calling it, fixes voice send/receive breaking
  • Remove redundant component::build_json()
  • fix: component buttons: copy the emoji of the first button if the first button has an emoji and following buttons have no emoji

👷 CI/Build

  • remove some warnings not supported by clang
  • fix: these warnings not supported on gcc8, gcc9 - fails CI
  • fix: make safe for a bunch more warnings, e.g. switch-fallthrough
  • now -Wall-safe
  • Warning set to 3 for windows builds
  • Disabled warning 4251 on windows as it is given by exporting classes or structures with stl member variables (this is perfectly safe for our use case)

📚 Documentation

  • #126, properly hide our crawl links div and update to doxygen-awesome-css 1.6.0
  • created an embed example page
  • spdlog example now includes dpp after spdlog. add_subdirectory() for the spdlog added in the example of 'Building with CMake'
  • fixed css name
  • add register_commands() to commandhandler example
  • fix minor typo in commandhandler example
  • amendment to #119 - -note-colour-darker is better for eyes
  • docs: improvements to indexability
  • re added struct forward decl to commandhandler::route for doxygen
  • docs: document new methods
  • makedocs internal script
  • feat/docs: version dropdown

Thanks for using D++!

DPP - v9.0.7 release

Published by braindigitalis about 3 years ago

After another week of development, D++ 9.0.7 has finally arrived! This release adds some huge new features for you, such as:

  • Voice receiving support (this is not officially supported by Discord but has proven stable for us and has been available in some other non-C++ discord libraries too for some time, so use at your own risk)
  • Ability to make arbitrary HTTP(S) requests through the D++ library bypassing the Discord REST queue
  • Support for role icons

We also now have a new documentation site at dpp.dev which is mobile friendly, fast, and easy to navigate. This replaces the old documentation at dpp.brainbox.cc which will be removed at some point in the future.

This is again a recommended upgrade, if you wish to stay current with Discord API features. If you need help or support with this library you can as always get help on the official Discord server.

Release Changelog

💥 Breaking Changes

  • Fix: guild_get_members (non-cached guild member fetch) now works correctly and has additional parameters
  • Fix for commandhandler registration to use bulk commands. This means that you must now call the new register_commands() method after adding commands to the handler if you are using slash commands.

✨ New Features

  • dpp::cluster::request() allowing for arbitrary HTTP requests through the library
  • Calculate opus packet duration internally
  • Add additional voice receive/status events
  • add role icon support
  • add guild_search_members function
  • Add respective objects mentioned in a message
  • finally allow dpp::utility::exec to run in windows
  • add silence method, and auto call it when connection becomes ready

👷 CI

  • Auto update windows-bot-template on successful master push. This means that the windows-bot-template repository will automatically remain current with the D++ master branch.
  • clean apt lists after install as per Codacy recommendation
  • attempt to fix MacOS CI by adding brew install OpenSSL as suggested by ray21
  • build: add Dockerfile

🐞 Bug Fixes

  • Message reaction events trigger correctly and don't depend on cache
  • Fix invalid endpoint in role_create function
  • Fix flags property of user - add public_flags
  • Fix audio not playing as raw
  • Amend comment for on_voice_receive
  • Don't use pointers for image_data property.
  • code refactor
  • pinned apt packages in Dockerfile as recommended by Codacy
  • codacy recommend fixes

📚 Documentation

  • Fix general typos and mistakes in the docs
  • Add some coding style re braces, and add reference to voice receive
  • Voice receive example
  • Add some coding style re braces, and add reference to voice receive
  • Mobile style cleanups
  • Relocate old URLs to new site
  • Docs beautification
  • Add MP3 streaming example

Thank you for using D++!

DPP - v9.0.6 release

Published by braindigitalis about 3 years ago

We are happy to announce the 9.0.6 release of D++! This is quite a big release, with a whole load of fixes, changes, and enhancements listed below, and is a recommended upgrade especially for windows users and users of voice/audio. Many of the changes have been in relation to voice support, making things more stable, flexible and adding support for different use cases that many of you have requested. As always if you need assistance you can find us on the official support server!

Release Changelog

💥 Breaking Changes

  • better handling of failure to auto-shard, throws a catchable exception instead of leaving a dead cluster
  • Split discord_voice_client::send_audio() into two different functions discord_voice_client::send_audio_raw() and discord_voice_client::send_audio_opus(). It is also possible to set different duration on the packets sent to send_audio_opus(). Using this function saves on having to re-encode the stream again.

✨ New Features

  • add self_deaf and self_mute to the voice connect calls as optional bools
  • add functions to get/set timescale for audio
  • Library now generates pkg-config file on installation
  • Official FreeBSD support
  • add co_number and co_mentionable handling for slash commands, also increase int32_t integer value to int64_t
  • Ability to send pre-encoded opus frames directly to the audio system

👷 CI

  • add win32 (32 bit windows debug/release) builds

🐞 Bug Fixes

  • Fix internal const correctness in strptime
  • fix disconnecting from voice (forcing disconnection as moderator made it never able to reconnect again)
  • Fix windows builds not booting in some situations
  • Add dummy ptrs into discord_voice_client so that it doesn't break if the user builds their bot without HAVE_VOICE defined, but built the lib with it
  • Opus encoder/decoder/repacketizer pointers were uninitialised on all but the first construction of discord_voice_client causing potential stack corruption and crashes
  • Switch case break; was missing in commandhandler.cpp
  • change internal maps to const static
  • default slashcommand type to ctxm_chat_input
  • move opus.h into discordvoiceclient.cpp so that there is no reference to its headers on the public API side
  • sanity checks for destructing REST queue, allows dpp::cluster to be destructed properly

📚 Documentation

  • add set_type to the button components example
  • Add ogg opus streaming example
  • Update voice examples
  • Menus rejig, make a 'building a bot' section -- good for SEO and usability
  • really cool 'how to make a bot in vs' tutorial
  • Add an example for application sub-commands usage
  • doxygen runs are now clear of warnings

Thanks for using D++!

DPP - v9.0.5 release

Published by braindigitalis about 3 years ago

We are happy to announce the official release of D++ 9.0.5! This release brings a whole set of fixes and improvements to any project using the library, including one breaking change listed below.

The new release also brings with it pre-compiled .deb files for armv6 (Raspberry Pi Zero and Raspberry Pi Zero W) support. This allows you to use a pre-compiled D++ library even on really old or slow Pi devices. Please note that the armv6 version does not support voice, as the Pi Zero (which it is intended to be run on) is generally too slow and low spec to do this. If you really want voice support on an arm6 device we recommend you cross-compile the library.

We have also added a windows debug build (still x64) so that you can include a pre-compiled release in a windows debug project.

Release changelog

💥 Breaking changes

  • The dpp::slashcommand resolved parameter types now have the type dpp::resolved_member where before it had dpp::user. The resolved_member struct is a structure which contains both a dpp::guild_member and a dpp::user as the Discord API provides both, and both are useful when handling application commands. Where you are using dpp::user as a resolved command parameter, please switch to using dpp::resolved_member instead.

🛠 Improvements

  • add ephemeral attachments to interaction responses
  • add cluster::rest_ping, tells you the ping latency of HTTPS requests from the library
  • Add version field of app commands
  • Update message types and flags
  • Update role permissions
  • Update command option type
  • Add ephemeral boolean to attachment.

🐛 Bug Fixes

  • safety checks for empty vectors when bulk adding commands
  • Fix guild_set_nickname bug (endpoint had wrong parameter)
  • fix application commands to prioritise application id passed in dpp::slashcommand over me.id from the dpp::cluster

📝 Documentation

  • extra docs for armv6 builds
  • additional FAQ entries
  • fix spelling error dependendancies -> dependencies

👷 CI

  • Clean and update ci.yml and toolchain files
  • Add ARMv6ToolChain.cmake to produce armv6 builds
  • add debug win64 build to produce debug pre-compiled windows builds

Thank you for using D++!

DPP - v9.0.4 release

Published by braindigitalis about 3 years ago

We are proud to announce the release of D++ 9.0.4, which contains a small raft of fixes! This release is a recommended upgrade and also adds functionality to use the 'resolved' section of the slash command interactions to ensure you always have information available regarding users, roles etc when they are mentioned in a slash command.

This release marks the official support of pre-built deb files for both ARM7 (armhf) for Raspberry Pi, and also a prebuilt x86 (32 bit) build for all you old-school people still using ancient hardware.

A full change log is listed below:

Release changelog

🛠 Improvements

  • add commandhandler::thinking() function to send a 'bot name is thinking...' interaction response, and remove deprecated interaction response types
  • Resolution of parameters in slash commands should no longer rely on cache. Use cache if we can find a value in it, otherwise use the 'resolved' field of the slash command. This makes this viable for bots with cache disabled such as triviabot

👷 CI

  • Add Linux i386 .deb packages
  • Add ARMHF .deb packages & Improve ARM CI

🐛 Bug Fixes

  • fix: Issue #71 - unified command handler and slash command handlers had no proper way to represent a truly undefined value in the variant, use std::monostate for this.
  • Merge pull request #70 from RealmsMud/execute_webhook_and_user
  • fix: release building fixes, attempt to set correct arch for aarch64 packages
  • Use the webhook token, if provided. Add "username" to messages if there is an author, currently only used for execute_webhook
  • Fix guild ban event which wasn't properly banning

Thank you for using D++!

DPP - v9.0.3 release

Published by braindigitalis about 3 years ago

I am happy to announce the release of D++ version 9.0.3! The 9.0.3 release contains a raft of small fixes from pull requests, but the biggest change of all is that we are now offering ARM64 packages for the Raspberry Pi, which will cut down on time taken to get this library up and running on the Raspberry Pi (or any other ARM64/aarch64 based Debian install).

If you want to make use of these prebuilt versions, you can find them below in the assets for the release.

Release changelog

🛠 Improvements

  • use dpp::exception instead of std::runtime_error for dpp exceptions thrown
  • add dpp::exception as part of PR #65
  • [impro] Define API_PATH only in discordclient.h
  • [improvement] Add interaction_create_t::get_original_response(command_completion_event_t)

🐛 Bug Fixes

  • [fix] Validate std::function before calling
  • dont hardcode v9 in the squelch for /gateway/bot endpoint
  • Fix for missing virtual on dpp::managed dtor, reported in Issue #63 It doesnt seem that any of the objects that were derived from dpp::managed needed any special destruction so there would have been no leak (hence why valgrind never flagged anything) but in the future this could have become a problem.
  • [fix] Use "-rdynamic" as a linker option - fixes Clang's warnings
  • [fix] Change get_original_response() to use command's app id
  • fix: changelog building was broken in release builder script

👷 CI

  • [feat] Add AArch64 .deb packages to CI

Thank you for using D++!

DPP - v9.0.2 release

Published by braindigitalis about 3 years ago

We are pleased to announce the release of D++ 9.0.2, continuing with our agile release methodology. This is a recommended upgrade, especially for Windows users as it adds some missing exports to the DLL which may have made it harder to use the library without. There are also some important fixes regarding dpp::commandhandler. For a full list of changes in this version please see the changelog below:

🛠 Improvements

  • improvement: enable voice support on windows. This will also work in the precompiled versions. Please report any bugs you find!
  • improvement: specify proper type for SOCKET on windows, as its actually uint64_t

🐛 Bug Fixes

  • fix: dpp::utility::has_voice() always returning false even when there is voice support
  • fix: dpp::find_user(), dpp::find_guild() etc inaccessible in windows dll build
  • fix: fmt::format not exported to windows dll build, requires header only when used in user side code
  • test: Added some test cases to check that exports are working and reporting correct values
  • fix: forgot shutdown() calls on all the close() calls.
  • fix: add delete for the thread objects in queue.cpp, which have a lifetime of the entire process anyway.
  • fix: squash bug with optional parameters to a dpp::commandhandler object

📚 Documentation

  • docs: fix copyright header in new files

Thank you for using D++!

DPP - v9.0.1 release

Published by braindigitalis about 3 years ago

We are happy to announce the 9.0.1 release of D++!

This release concentrates mainly on the windows stability of the project. OpenSSL and ZLib are now packaged within the repository and pre-compiled for windows users, so that compiling D++ is now easier than ever! Just open the project in visual studio 2019 and hit F7 and it should build without issue.

We have also confirmed that D++ runs great on Raspberry Pi (however it may take some time to build). A future release will include prebuilt Debian installers for the Pi.

From 9.0.1 onwards our CI system will output compiled build files for every push, so as a windows user if you need a prebuilt hot-fix you can find them in the actions tab on the GitHub project.

Thanks for using D++!

DPP - 9.0.0 Release!

Published by braindigitalis about 3 years ago

We are happy to finally announce the 9.0 release of D++! 👏 🎉

❓ You may be asking, why is this version 9.0 when the last release was 1.0.2? What happened to version 2, version 3, etc? We have decided to synchronise our major version number with the supported Discord API version the library supports. As this new version officially supports Discord API v9 (and only v9) our major version is now 9.0.

🆕 As this now supports a newer, shinier version of the Discord API, this release supports the following new features amongst many other things:

  • Threads support (manage conversation threads via the D++ library)
  • Support for button, select dropdown list and context menu UI elements and interactions
  • Support for even more slash command features
  • Sticker support
  • Support for a generic command handler that will work with slash commands and channel message commands
  • Ability to disable or configure caching at runtime for each individual cache, e.g. users, emojis, roles
  • Better error handling and reporting for REST calls

...And much much more! There are also many fixes so if you are still using 1.0.2 you are strongly recommended to upgrade.

🪟 This version includes a prebuilt windows 64 bit debug build in the assets below. This may or may not suit your individual development needs, if it does not function as expected for you please build from source using the github master branch or the 9.0.0 release tag.

DPP - 1.0.2 release

Published by braindigitalis over 3 years ago

This is the 1.0.2 release of D++!

This release fixes some issues with interactions, and refactors the camel case names remaining in the lib to match the correct snake case, e.g. DiscordClient becomes discord_client and ConnectVoice becomes connect_voice. Be sure to update your code when you update to this version.

Windows support is still experimental and should be avoided for the time being. To run this library on windows use WSL2.

DPP - 1.0.1 release

Published by braindigitalis over 3 years ago

This is the 1.0.1 release of DPP, which is a recommended upgrade to all users of 1.0.0.

This release fixes several issues, notably detection of correct number of shards not functioning all of the time and sometimes silently bailing, and cloudflare randomly dropping websockets forcing a resume.

Also fixed is a bug in cluster::current_user_leave_guild which would crash if no callback was provided to it.

There are many smaller bugfixes and quality of life improvements, for more information please don't hesitate to ask on our official discord.

We will not be releasing prebuilt windows builds until the windows version stabilises. Until then we recommend you build from source and stick to Linux builds where possible.

Thank you for using D++!

DPP - 1.0.0 release

Published by braindigitalis over 3 years ago

This is the first official release of D++, the C++ Discord Library.
Please note that for the windows binary build, the function dpp::utility::exec() and voice support are not enabled. They may be enabled on the compiled windows binary build at a future date.

Package Rankings
Top 9.59% on Proxy.golang.org
Top 30.73% on Formulae.brew.sh
Badges
Extracted from project README
Discord Codacy Badge OpenSSF Best Practices D++ CI OpenSSF Scorecard AUR version XBPS version Homebrew version Contributor Covenant Discord