C++ Discord API Bot Library - D++ is Lightweight and scalable for small and huge bots!
APACHE-2.0 License
Bot releases are hidden (Show)
Published by braindigitalis over 2 years ago
We are pleased to announce the release of D++ 10.0.9! This new version further splits out events to give a separate on_slashcommand event, which can be used just to receive chat input
type interactions.
Thie release also fixes some deadlocks in the new voice receive code in certain situations, and Discord now support registration of global commands instantly, which means we can use global slash commands in most of our examples.
The changelog is listed below:
on_slashcommand
event that only receives ctxm_chat_input
- this has its own parameter typeSECURITY.md
bug_report.md
discord_voice_client
hanging in destructor, again.discord_voice_client
destructor.application.cpp
and added url helpers in applicationThank you for using D++!
Published by braindigitalis over 2 years ago
We are proud to announce that D++ 10.0.8 is now available! This release is packed to the brim with new features, fixes and improvements, at the forefront of these enhancements are:
on_interaction_create
- the old method still works too, so you aren't forced to change your bots if you dont want to or don't have the time to.event.reply()
method for interactions, which can be called with no parameters to acknowledge a button or select list without sending a message....and much more!
The changelog is listed below:
on_message_context_menu
/on_user_context_menu
, nicer ways of accessing context menu actions for slash commands. the old way of accessing this still works too.interaction_followup_create
, interaction_followup_edit_original
, interaction_followup_delete
, interaction_followup_edit
, interaction_followup_get
; resolves issue #358event.reply()
with no params (or just callback) to acknowledge button or select without a messageREADME.md
cspell.json
audio_mix
std::max
user_id
field in voice_receive_t
in case of lost packet.HAVE_VOICE
in the headerslashcommand::set_name
Thank you for using D++!
Published by braindigitalis over 2 years ago
We are pleased to announce the release of D++ 10.0.7! This new release provides support for the new slash command permission system, support for localization, and removes support for the older default_permission
boolean flag.
Several fixes have been also been made for voice and for synchronous HTTP functions.
The changelog is listed below:
dpp::voiceconn
when disconnecting from a voice channel.GUILD_JOIN_REQUEST_UPDATE
__next_handle
, oopsdefault_permission
has been removed from slashcommandmessage_update
now has the same style of signature as message_create
, no pointer, and object called msg. This is to allow for a template to work on bothguild_bulk_command_create
'ssl_ctx
per thread, cuts down on memory and speeds up connectionutteranc.es
utteranc.es
to all pagesThank you for using D++!
Published by braindigitalis over 2 years ago
We are pleased to announce the release of D++ 10.0.6! The 10.0.6 release adds a new feature to help speed up REST requests made to Discord whilst still staying in line with rate limits. Where requests fall into different rate limit buckets, they will be parallelised by D++ and run alongside each other. By default, up to 8 buckets can be ran in parallel, you may increase this value either with a parameter to the dpp::cluster
constructor, or at runtime using for example bot.get_rest()->add_request_threads(8)
which would add a further 8 threads to the pool. Note that you cannot decrease the number of threads at runtime without deleting the dpp::cluster
and constructing a new one.
The changelog is listed below:
post_rest
because interaction_create_t
is not valid after an interaction event returnsdpp::invalid_token_exception
when bad token given at cluster::start
- derived from dpp::rest_exception
so not a breaking changeset_channel_id
and set_guild_id
to messageThank you for using D++!
Published by braindigitalis over 2 years ago
We are happy to announce the release of D++ 10.0.5, which includes several bugfixes, and also includes a breaking change to the parameters to guild_get_bans
and guild_get_bans_sync
due to Discord adding additional parameters API-side.
There have been several performance improvements to the library, and we have added colour constants, default error logging to all callbacks if not specified, operator==
for all dpp::managed
derived objects and more!
The changelog is listed below:
shared_mutex
, this will allow for some fun stuff (tm) later. Also, decrease timeout of queue thread by 10x to ensure things stay snappy in quiet patchesHEAD_REF
.uint32_t
and add include to dpp.h
guild.h
& guild::get_banner_url
can now return gif image urlsguild_get_bans
README.md
cluster_sync_calls.h
cluster.h
cluster::guild_member_kick
log_error
premium_progress_bar_enabled
, fixes #270guild_member_timeout_sync
guild_member_timeout
and updated docsset_guild_id
dpp::managed
guild_get_bans
guild_get_bans
and guild_get_bans_sync
now support limit, before and after, and return a maximum of 1000 bans per calldpp::timer
to timer_callback_t
set_required
Thank you for using D++!
Published by braindigitalis over 2 years ago
Version 10.0.4 of D++ is here!
This version of D++ includes the ability to call cluster methods such as message_get
etc synchronously, as in, they wait until the command is complete and directly return a value instead of needing a lambda. These functions are identical in name to the asynchronous ones, except their name ends in _sync
, e.g. message_get_sync()
. These functions have specific uses, please be sure to read the docs for them on dpp.dev!
The changelog is listed below:
dpp::cluster
dpp::sync
, remove cmakelists duplication, add dpp::sync
unit testdpp::sync
json_interface.h
dpp::sync()
for syncronous REST callsThank you for using D++!
Published by braindigitalis over 2 years ago
We are pleased to announce the release of D++ 10.0.3! This release adds, amongst other things:
confirmation_callback_t
, as std::holds_alternative
can do this insteadThe changelog is listed below:
BUFSIZZ
user::get_avatar_url
json_fwd.hpp
dpp::utility::version()
json_interface
that specifies the standard methods the rest_request<>
template usesurl_encode
, move to utility namespace, expose a bunch of internal templates in dpp namespace from stringops.hsticker::get_url
close-master-pr.php
confirmation_callback_t
, because its possible to use std::holds_alternative
for this on the valueThank you for using D++!
Published by braindigitalis over 2 years ago
We are happy to announce that D++ 10.0.2 is here! It features a lot of quality-of-life improvements listed below, and some small fixes. Our current drive is to improve documentation of existing features. If you feel you would like to get involved with this please do submit a PR!
Major changes:
dpp::utility::markdown_escape()
dpp::utility::uptime
taking a double for use with time_f()
updated: library now checks when you bind an event to certain types if you have the privileged intent needed to use them, if you dont it will emit a warning to the log explaining what is neededwrite()
error checkingThank you for using D++!
Published by braindigitalis over 2 years ago
After a busy week of development we are proud to announce the release of D++ 10.0.1! The 10.0.1 branch comes with a lot of refactoring, performance improvements, and quality of life improvements. Amongst these improvements are some shorthand ways of handling and declaring slash commands to make this simpler. To see this in action check out the first bot tutorial.
We have also updated nlohmann::json to 3.10.5 and fmtlib to 8.1, the latest available versions. Our Docker image (brainboxdotcc/dpp:latest) is now kept up to date with our master
branch at all times, making it useful as a deployment option - see here for an example of how to use this to deploy a D++ bot via a Docker image.
The changelog is listed below:
dpp::interaction
that streamline slashcommand events, add dpp::utility::cout_logger()
, and add two new interaction_create_t::reply
overloads that just take a message or stringThank you for using D++!
Published by braindigitalis over 2 years ago
🎉 We are pleased to announce the 10.0.0 release of D++! 🎉
As our version releases match the supported API versions, and discord have recently announced version 10 of the Discord API, we are bumping our own version up to 10.x to indicate support for this new version.
If you have recently updated to the last 9.x version, there is no immediate need to upgrade as we are aware this was only a couple of days ago. The changes in the v10 release are minimal and this release is somewhat ceremonial.
Enjoy!
The changelog is listed below:
Thank you for using D++!
Published by braindigitalis over 2 years ago
We are happy to announce the release of D++ 9.0.19! This version features a rewrite of the HTTP system of the bot which makes REST requests. We have replaced it with something faster, more compact, and easier to maintain, which also fixes some long-standing bugs with windows file uploads.
Alongside this we have also made modal dialogs a stable API feature in the library, and added support for slash command attachment uploads parameters. dpp::utility::read_file
is also now fixed on windows. Many small methods have been added, which are quality of life fixes such as user::format_username()
.
The changelog is listed below:
dpp::invite
user::format_username()
and utility::bot_invite_url()
dpp::component
event.thinking()
channel::add_permission_overwrite()
global_command_get
as it was missingdpp::guild_command_get
as it was missingfill_from_json
methodsdouble_not_null
guild_commands_get_permissions
, guild_bulk_command_edit_permissions
and guild_command_get_permissions
dpp::command_source
dpp::command_source
dpp::utility::read_file
on windowsrole_edit()
command_option::fill_from_json
communication_disabled_until
parsing in guild_member::build_json
communication_disabled_until
parsing in guild_member::build_json
dpp::interaction_create_t
cluster::guild_search_members
cluster::guild_get_members
guild_member::build_json()
command_option_choice::fill_from_json
and added unit test for itco_attachment
parameter typeThank you for using D++!
Published by braindigitalis over 2 years ago
We are proud to announce the release of D++ 9.0.18! This version introduces a few new feaures, the most notable are:
The changelog is listed below:
emoji::format
didn't return animated emojischannel_edit_permissions()
overload & const paramsdpp::invite
, fixed bug where guild_id was not setdpp::channel
dpp::guild_edit_widget
dpp::embed
create_timestamp
to thread_metadata
Thank you for using D++!
Published by braindigitalis almost 3 years ago
After a long Christmas break we are happy to bring you D++ 9.0.17! Now that the large man in the red hat has been, we give you one final late present of a new release. This is mainly a quality of life release, with a few fixes as listed below.
The changelog is listed below:
guild_member::is_communication_disabled()
utility::cdn_host
constant and utility::avatar_size
Thank you for using D++!
Published by braindigitalis almost 3 years ago
We are happy to announce the release of D++ 9.0.16! This version adds support for the newest Discord API features including member timeout, for when you really want your bot to stick a user in the sin-bin and leave dealing with it to Discord.
It also adds support for interaction locale fields, and some quality of life fixes for event routers.
There is experimental support for modal dialogs, but this is not yet available for general use by Discord and will be released in due course. For more information of this stay up to date with developments on our support server!
The changelog is listed below:
find_guild_member()
bool()
for event_router_t
on_form_submit
event for modal dialogshandle_buffer()
on thiscollector::filter
Thank you for using D++!
Published by braindigitalis almost 3 years ago
We are very proud to announce the release of D++ 9.0.15! This release is a recommended upgrade for all, as it includes several stability and performance released improvements plus some fixes.
There is an important breaking change in this release; All objects and properties in the message event are now accessed on the stack with the dot (.
) operator. for example, event.msg.author.id
, Please be aware of this and be prepared to refactor this part of any bots you are updating!
Alongside this we are also adding new types for your use such as dpp::collector and dpp::cache - check them out, i'm sure you'll find a good use for them in your bots!
The changelog is listed below:
dpp::message
and author are stored to not be pointers. more user friendly and trivially copyablechannel_edit_position
to channel_edit_positions
get_mention()
for user, guild_member, role, emoji, channel, plus utility::timestamp()
, adds support for all mentionable ping formats as documented here: https://discord.com/developers/docs/reference#message-formatting
managed::get_creation_time()
, returns creation timestamp of any object with a snowflake iddpp::collector
and derived forms for object collectiondpp::managed
.guild_create_t
on_guild_create
event, will be filled only if presences privileged intent is setcurrent_user_set_voice_state
, user_set_voice_state
dpp::voice_exception
when not built with voice support instead of silently failingrole::premium_role
wasnt working because discord api has a bugreaction_collector::completed
channel_edit_position
cache<T>::get_mutex()
dpp::cache
Thank you for using D++!
Published by braindigitalis almost 3 years ago
We are proud to announce the 9.0.14 release of D++! This release adds support for timed listeners, timers and one-shot timers, enhances the event system, adds fixes for guild scheduled events and many other features and smal fixes.
It is a recommended upgrade, with improvements in performance and additional API support.
The changelog is listed below:
Thanks for using D++!
Published by braindigitalis almost 3 years ago
We are pleased to announce D++ 9.0.13, a minor feature release which adds full support for the new Guild Scheduled Events feature of the Discord API. Alongside this are some minor fixes and quality of life tweaks as documented below.
This is upgrade is recommended if you wish to use the new guild scheduled events feature in your project.
thread_create
functionsmessage_create_t::send()
& reply()
message_reference
was missing from created messagesThanks for using D++!
Published by braindigitalis almost 3 years ago
The 9.0.12 release of D++ is now available! This release has a lot of small changes, some of them breaking changes, which bring the library up the the current bleeding edge Discord API. All new channel flags, guild flags and other features are supported.
Alongside this, the return types of some lambdas (callbacks) have changed, e.g. the addition of dpp::user_identified
for users which contain oauth2 specific fields and changes to the reaction events to work when caching is disabled, or the cache is out of date. The names of some functions have also been changed to match our naming conventions in dpp::cluster
, and thread calls now use the separate dpp::thread
class as opposed to dpp::channel
.
This is a recommended feature upgrade for all who wish to stay current with the latest Discord API features in their bot!
pins_get
to channel_pins_get
, get_guild_invites
to guild_get_invites
dpp::user_identified
as a derivative of dpp::user
dpp::thread
and dpp::channel
, thread is derived from channelreacting_user
to snowflake reacting_user_id
in message_reaction_remove
eventattachment::download()
, for downloading an attachmentrole::get_members()
, helper function to get all members of a roledpp::guild
plus turn some uint8_t
fields into enums to make them more user friendlyvideo_quality_mode
, rtc_region
, permissions
(only for use in an interaction
) and thread_member
to dpp::channel
and dpp::thread
message
members/ctorslashcommand
name to 32 chars and desc to 100 chars (utf8)strptime
use on win32messages_get
limit to uint8_t
and clamp it at 100messages_get
had an invalid http body and would throwchannel_edit
dpp::slashcommand
setterschannel_get
, guild_get
iconhash
unit testsThanks for using D++!
Published by braindigitalis almost 3 years ago
We are pleased to announce the 9.0.11 release of D++! This release includes some hotfixes to make voice connections work again (for those of you who were struggling to connect to voice channels), and adds prebuilt RPMs to our release schedule.
If you were having issues with voice this is a strongly recommended upgrade.
global_command_create
and guild_command_create
alter the referenced variable, this is not threadsafe. was even documented too -- not sure where this came from. Reference is now const
OP_TEXT
type framespush_back
for emplace_back
CMAKE_BUILD_TYPE
rather than our own BUILD_DEBUG
-DBUILD_DEBUG
and -DBUILD_O3
for debug builds and speed-optimised builds. both off by default-Os
instead of -O3
optimisation flag. This is -O2
without code bloating optimisations. The size of the release is just getting too big to manage.Published by braindigitalis almost 3 years ago
We are pleased to announce the release of D++ 9.0.10! This release is mainly a feature release, with a whole lot of features listed in the changelog. Amongst other changes, the library now supports slash command parameter auto completion, minimum and maximum numeric values, and allows for multiple listeners to safely hook the same events.
For full details of the changes please see the change log below!
interaction_create_t::thinking()
cluster::current_user_connections_get
- needs oauth2 connections scopesize_t
detach_
methods for all event listenerscluster::current_application_get()
and classes application
, app_team
, team_member
utility::rgb()
helper functionsmin_value
and max_value
on dpp::command_option
with type co_number
or co_integer
thread_member to confirmable_t
cluster::get_thread_member
commandhandler
functionsbitrate
, Fix rate_limit_per_user
to act as slowmode insteadevent_dispatch_t
derivativesThanks for using D++!