Repository navigation
Releases
yl-discord.cpp v0.4.1
yl-discord.cpp v0.4.1
Maintenance release for the transfer to YoungLionOrganization and command parsing.
The C++20 coroutine API and LGPL-3.0-or-later license remain unchanged.
Repository and packaging
- Canonical repository: YoungLionOrganization/yl-discord.cpp.
- Updated CMake/Conan metadata, vcpkg/MSYS2 source generators and package templates.
- Updated badges, download/setup links, issue/security links and HTTP User-Agent.
- Preserved original author/copyright notices and immutable published tags/assets.
- Added a regression check for consistent package/runtime repository identity.
- Track VERSION as a CMake configure dependency so incremental builds regenerate
version headers, package metadata and versioned shared-library names.
Command correctness and performance
- Resolve a command name before interpreting its argument tail. Unknown names
are ignored even if their unused arguments contain malformed quotes/escapes. - Preserve canonical command name, invoked alias and original Message when a
known command's argument syntax is invalid. The incomplete argument list is
not exposed as a successful parse. - Share token-scanning logic between command lookup and the public parser,
preserving quoted/escaped names, empty arguments and normal argument behavior. - Avoid allocating a combined command/argument vector and shifting all arguments
to remove its first element. This is a targeted synthetic-path optimization;
it does not establish a general live-bot speed advantage.
Documentation and validation
- Ordered roadmap with priorities, proposed milestones and completion criteria.
- Offline benchmark tooling, raw samples and reproduction/interpretation guidance.
- Regression coverage for unknown malformed tails, syntax-error Context identity,
quoted/escaped aliases and empty arguments. - Local validation: six CTest suites, including 13 core, 11 command, 15 event,
6 embed, 6 file and 16 network scenarios, plus 12 release-tool tests. - Publication requires Linux/Windows static/shared builds, sanitizer checks and
Conan, vcpkg and MINGW64/UCRT64 package consumers through the release workflow.
No authenticated Discord smoke test was run. Existing dependency licenses and
the documented experimental API/ABI policy still apply. Rebuild shared consumers
for the versioned v0.4.1 runtime library.
Downloads and guides
yl-discord.cpp v0.4.0
yl-discord.cpp v0.4.0
This normal minor release adds bounded, buffered multipart uploads and explicit
attachment editing. Package version: 0.4.0.
Files and messages
- FileUpload owns immutable shared byte buffers with independent filename,
description and content-type metadata. Copies do not duplicate large buffers. - Text and binary construction preserve embedded NULs. There are no implicit
filesystem reads, URL downloads or transcoding operations. - MessageOptions::files supports file-only sends/replies and attachment:// embeds.
- REST uses libcurl MIME read/seek callbacks over the existing async multi engine,
without constructing a second full multipart byte string. - Server 429 retries use fresh upload cursors; uncertain writes are not retried.
- MessageEditOptions requires explicit retained attachment IDs when adding files;
omitted fields preserve files, an empty retention vector clears/replaces them. - Response Attachment models retain IDs, names, uint64 sizes, descriptions, media
types and URL metadata. Message values remain owned snapshots. - MemoryTransport stores synthetic metadata and records upload/retention intent.
Unsupported older text-edit transports reject attachment edits explicitly.
Bounds and lifecycle
Typed limits are 20 MiB per file, 24 MiB combined new bytes and 10 total retained/
new attachments. The multipart builder checks a 25 MiB request budget with 64 KiB
reserved for framing; large JSON metadata can reduce the remaining file budget.
Filename/MIME/description validation prevents control/header injection and rejects
ambiguous upload labels. Discord still enforces its own current permissions,
media checks and account/channel limits.
Uploads share TLS validation, rate-limit queues, deadlines, User-Agent metadata
and close cancellation. Tests cancel an active 8 MiB upload without waiting for
the server to drain its socket. Rebuild consumers: public models extend in this minor.
Validation and distribution
Validation includes 13 core, 10 command, 15 event, 6 embed, 6 file, 16 local
HTTP/WebSocket and 11 release-tool scenarios. Multipart fixtures verify binary
bytes, UTF-8 names, NULs, 429 replay, retained/new/cleared files and file-only replies.
Installed consumers exercise the new file payload across static/shared boundaries.
CI covers Linux GCC/Clang, Windows MSVC/MinGW, ASan/UBSan, Conan, vcpkg and native
MSYS2 MINGW64/UCRT64. Six offline examples and a live ping bot compile; automated
runs never contact Discord or load a real bot credential. Authenticated Discord
smoke testing remains owner-initiated.
Release assets include source ZIP/TAR.GZ, vcpkg overlay, native MINGW64/UCRT64
packages, MSYS2 recipe, release notes and SHA256SUMS. Optional Conan remote upload
requires owner-configured credentials; no central-registry listing is claimed.
Slash commands, UI, stream/filesystem upload sources, progress hooks, broad guild/
member APIs, voice, sharding and production caches remain planned. No general
performance advantage over discord.py is claimed.
Licensed under LGPL-3.0-or-later.
yl-discord.cpp v0.3.0
yl-discord.cpp v0.3.0
This normal minor release adds event control and rich messages to the live bot
and command core. Package version: 0.3.0.
Event control
wait_for<Message/Ready/RawEvent>()observes future dispatches with synchronous
predicates, owned results and monotonic deadlines.- Standard stop tokens (including cross-thread requests), native Asio cancellation
andclose()cancellation release pending waits and predicate captures. - Removable Message/Ready/RawEvent subscriptions return weak ListenerConnections.
Disconnection retains callbacks already snapshotted for an event. - Predicate failures are isolated; foreign event loops are rejected. Paused time
still counts toward a wait's deadline. Unstarted waits register nothing. is_cancelled(error_code)recognizes header-only Asio cancellation across
shared-library error-category instances.
Rich messages
- Owned Embed, EmbedField, EmbedFooter and EmbedAuthor models.
- MessageOptions for content/embed sends and replies with explicit AllowedMentions.
- MessageEditOptions distinguishes preserving omitted content/embeds from clearing
them with an explicitly empty string/vector. - Outgoing UTF-8 validation, conservative UTF-16 limits, per-field/combined embed
bounds, URL policy and mention flag/whitelist validation before HTTP. - Mention parsing and reply pings remain disabled unless explicitly enabled.
- Supported rich fields parse from Gateway and REST into bound message snapshots.
- MemoryTransport stores rich snapshots and records structured edit intent.
- Older text-edit custom transports retain their fallback for content-only edits;
unsupported rich edits fail explicitly.
Packaging and validation
Rebuild consumers: this minor extends public models and virtual interfaces.
Installed shared consumers now verify their configured curl runtime as well as
command, message, event and rich-payload behavior. Runtime discovery instructions
cover custom dynamic curl prefixes. Five offline examples and one live ping bot
compile in CI; automated examples never use a real Discord credential.
Validation includes 13 core, 10 command, 15 event, 6 embed, 14 local HTTP/WebSocket
and 11 release-tool scenarios. Platform coverage includes Linux GCC/Clang,
Windows MSVC/MinGW, static/shared builds, ASan/UBSan, Conan, vcpkg and native
MSYS2 MINGW64/UCRT64 consumers. Authenticated Discord smoke testing remains
owner-initiated. No measured advantage over discord.py is claimed.
Attachments, slash commands, UI, broad guild/member APIs, voice, sharding,
production caches and managed Cog background tasks remain planned.
Assets and guides
Release assets include source ZIP/TAR.GZ, vcpkg overlay, native MINGW64/UCRT64
packages, MSYS2 recipe, release notes and SHA256SUMS. Optional Conan remote upload
requires owner-configured credentials; no central-registry listing is claimed.
Licensed under LGPL-3.0-or-later.
yl-discord.cpp v0.2.0
yl-discord.cpp v0.2.0
This release extends the live bot core with an everyday command toolkit and
awaitable message operations. Package version: 0.2.0. Normal GitHub release.
Commands
command<Args...>()binds owning typed parameters after Context; trailing
std::optional<T>parameters are supported.- Built-in string, integer, finite floating-point, bool and Snowflake/mention
converters; applications can specializeconvert_argument<T>(). - Strict arity and conversion errors, plus
Context::argument<T>()for manual parsing. - Global and command-level asynchronous checks, including guild-only, DM-only
and explicit user-ID helpers. - Sliding-window cooldowns with global/user/channel/guild scopes, shared aliases,
monotonic retry durations, reset support and bounded bucket counts. - Owned command metadata, generated usage, hidden help entries and opt-in
add_help_command()with UTF-8-safe pagination. - Invocation-aware
on_command_error(Context, exception_ptr)and original aliases. - Cog-wide command removal with in-flight callback/check ownership preserved.
Messages
- Client, bound Message and RestClient fetch/edit/delete helpers.
- Unicode/custom reaction creation and removal of the current bot's reaction.
- Mention suppression repeated on edits; content-only edits preserve other fields.
- URL-encoded emoji paths, normal empty 204 handling and shared rate-limit/cancellation behavior.
- Generic ProtocolError diagnostics for malformed successful message responses.
- MemoryTransport seeded snapshots and action records, with no transport ownership cycles.
- Existing send-only custom transports remain source-compatible; optional operations
default to lazy unsupported-operation errors.
Compatibility and validation
Rebuild consumers for this minor release: the public virtual transport interface
and experimental object layouts changed. The original manual Context callback
overload remains supported. Help is opt-in and checks do not request Discord permissions.
Typed conversion failures consume a cooldown slot after checks have succeeded.
Validation includes 13 core scenarios, 10 command scenarios, 12 local HTTP/WebSocket
scenarios, installed package consumers and release-tool tests. CI covers Linux
GCC/Clang, Windows MSVC/MinGW, static/shared builds, ASan/UBSan, Conan, vcpkg and
MSYS2 MINGW64/UCRT64. Tests use local fixtures, never a real Discord credential.
The authenticated Discord smoke test remains owner-initiated.
Slash commands, UI, embeds, attachments, broad guild/member APIs, voice, sharding
and production caches remain planned. No performance advantage is claimed without
equivalent-workload measurements.
Downloads and guides
Release assets include source ZIP/TAR.GZ, vcpkg overlay, MINGW64/UCRT64 native
packages, MSYS2 recipe, release notes and SHA256SUMS. Optional Conan remote upload
still requires owner-configured credentials; no central-registry listing is claimed.
Licensed under LGPL-3.0-or-later.
yl-discord.cpp v0.1.1
yl-discord.cpp v0.1.1
The first normal release in the v0.1 line, completing the live bot message flow
on top of the v0.1.0 offline foundation. Package version: 0.1.1.
Live bot support
- Default Client/Bot constructors,
run(token), awaitablestart(),close()
andtoken_from_env()for DISCORD_BOT_TOKEN. - Bot-authenticated REST and Gateway API v10 discovery/Hello/Identify/Ready.
- Heartbeat jitter/ACK, reconnect/resume, fatal close handling and identify budgets.
- MESSAGE_CREATE → prefix command →
co_await ctx.reply(...)→ actual HTTP request. - Nonblocking curl multi HTTP, verified TLS, deadlines and bounded response bodies.
- Route/shared-bucket/global limits with asynchronous 429 waiting and bounded retries.
- A 401 stops later requests; uncertain POST failures are not retried automatically.
- Fragmented WebSocket messages, control frames and repeated-sequence suppression.
- Network shutdown during requests, handshakes and rate-limit waits.
- Live ping/echo example with class-based events and Ctrl+C handling.
Release automation
VERSION/release metadata changes on main now create an annotated version tag and
call full publication directly. A GITHUB_TOKEN-created tag therefore still
leads to a published GitHub Release with files. Manually pushed tags also work.
Assets upload to a draft first; only a completed upload becomes public. Retrying
an already complete release keeps its files unchanged.
Validation and compatibility
Core tests, eleven local HTTP/WebSocket scenarios, installed consumers and package
builds cover the actual frame/JSON flow. CI includes Linux GCC/Clang, ASan/UBSan,
Windows MSVC/MinGW, Conan static/shared, vcpkg and both MSYS2 environments.
Automated tests do not use a real Discord credential. An authenticated Discord
smoke test remains an owner-initiated step.
Rebuild v0.1.0 consumers. Public object layouts expanded for networking.
Pre-1.0 shared libraries now use full-version soname/DLL runtime names to prevent
an old application from loading a new incompatible layout. Match compiler,
runtime and dependency versions for binary packages.
The API remains experimental. Slash commands, interactions/UI, voice, compression,
sharding, cache and broad guild/member models are not implemented. No measured
performance advantage over discord.py is claimed. Outgoing messages disable
automatic mentions. Prefix commands need Message Content Intent in code and in
the Discord Developer Portal.
Downloads
- Source ZIP
- Source TAR.GZ
- vcpkg overlay
- MINGW64 package
- UCRT64 package
- MSYS2 recipe
- Release notes
- SHA256SUMS
These are project-hosted packages; central registry inclusion is separate.
Optional Conan remote upload needs owner-configured credentials.
See live setup
and documentation.
Copyright (C) 2026 Cavanshirpro. LGPL-3.0-or-later; dependencies retain their licenses.
yl-discord.cpp v0.1.0
yl-discord.cpp v0.1.0
The first offline foundation prerelease of a C++20 Discord bot library inspired
by discord.py's ease of use. Package version: 0.1.0.
This release does not connect to Discord. It provides the async runtime,
event/command API and memory transport for development and testing. HTTP REST,
WebSocket Gateway, token login, slash commands and voice are not implemented.
The public API is experimental; no speed or memory advantage has been measured.
Included
task<T>,co_await, nonblocking timers and a single Asio event loop.- Client/Bot subclasses, async hooks, multiple listeners and error handling.
- Prefix commands, aliases, quoted arguments, Context send/reply and Cog classes.
- In-flight callback/Cog ownership, raw event dispatch and executor access.
- MemoryTransport, offline behavior tests and two working example programs.
- Static/shared builds, generated version/DLL headers and installed CMake consumers.
- Conan 2 recipe, commit-pinned vcpkg overlay and MSYS2 package automation.
- API/build/distribution/release documentation and MAJOR.MINOR.PATCH validation.
Downloads
From this release:
- Source ZIP
- Source TAR.GZ
- vcpkg overlay
- MINGW64 package
- UCRT64 package
- MSYS2 source recipe
- Release notes
- SHA256SUMS
Source archives include source, examples, tests, documentation, recipes and
license notices. Dependencies are not bundled. Native MSYS2 packages use
declared Asio/runtime dependencies and must match your compiler environment.
Project-hosted packages are not central ConanCenter/vcpkg/MSYS2 listings.
Build and try
Use a C++20 compiler, CMake >= 3.25, Ninja and standalone Asio >= 1.30.2. CMake
can fetch a pinned Asio commit when needed. Python >= 3.10 supports release tools.
cmake --preset default
cmake --build --preset default --parallel 2
ctest --preset default
./build/default/yl_offline_botOn Windows add .exe; use the matching MINGW64/UCRT64 runtime on PATH.
Consumers use find_package(ylDiscord 0.1 CONFIG REQUIRED) and yl::discord.
For setup and package instructions see
the documentation.
Copyright (C) 2026 Cavanshirpro. LGPL-3.0-or-later. Asio remains BSL-1.0.