Discord.Net.Extensions
1.2.1
dotnet add package Discord.Net.Extensions --version 1.2.1
NuGet\Install-Package Discord.Net.Extensions -Version 1.2.1
<PackageReference Include="Discord.Net.Extensions" Version="1.2.1" />
paket add Discord.Net.Extensions --version 1.2.1
#r "nuget: Discord.Net.Extensions, 1.2.1"
// Install Discord.Net.Extensions as a Cake Addin #addin nuget:?package=Discord.Net.Extensions&version=1.2.1 // Install Discord.Net.Extensions as a Cake Tool #tool nuget:?package=Discord.Net.Extensions&version=1.2.1
â Discord.Net.Extensions
This package introduces a number of features that assist Discord.Net as a library. It attempts to make work for the developer easier, by introducing extensions that perfectly support development needs.
âšī¸ How to install
Grabbing the package from NuGet:
The Discord.Net.Extensions package is available on Nuget or through the package manager:
PM> Install-Package Discord.Net.Extensions -Version 1.2.1
Installing from Visual Studio:
Just like Discord.Net, Discord.Net.Extensions is available from the NuGet package manager built into VS:
Installing from Rider:
Applying namespaces:
The naming of this package follows that of Discord.Net:
using Discord;
using Discord.Extensions;
Because the package is seperate, and not a part of the library itself, it levels down a single name on the namespace. It does still follow the naming of Discord.Net itself however:
using Discord.Interactions;
using Discord.Extensions.Interactions;
Depending on the namespace of the type you're looking to target, its extensions will be in the matching Extensions
namespace.
đ Features
Below a number of features is covered, including notices of logic, examples or exceptions.
đ Core
Message Formatting support
MessageBuilder
has been introduced to allow for large text message creation to look a lot cleaner & helps avoid a lot of markdown errors.
Alternatively, inside the
DiscordFormattingExtensions
class a large amount of formatting extensions exist, allowing developers to customize messages with ease.
Builder Factories
EmbedBuilderFactory
ComponentBuilderFactory
ModalBuilderFactory
These factories generate builders based on the actions defined in
BuilderSettings
. View the Samples for how to use it.
đ¤ Rest
In progress...
⥠Websocket
In progress...
đĒ Webhook
In progress...
â Commands
In progress...
â Interactions
IModal to ModalBuilder support
Thanks to the design of modals in Discord.Net, a few extensions have been added to turn IModal
's into ModalBuilder
's with populated values.
Generic Context Generation
For each type of Interaction
a method has been introduced to automatically generate generic IInteractionContext
,
supporting the use-case of XInteractionContext<XInteraction>
.
View the Samples to learn how to use these methods.
Type converters for commands, modals & components.
TypeReaders
Color
TimeSpan
*Guid
IEmote
**
TypeConverters
Color
TimeSpan
*UInt64
***IEmote
**
ComponentTypeConverters
Color
TimeSpan
*IEmote
**
* The
TimeSpan
converters run through a reader far more advanced than a simpleTryParse
. It supports formatting such as: 1d16h10m up to 10 weeks, 4 months & 7 seconds. Parsing does not respect order, and works in any format.
** The
IEmote
converters supportEmoji
andEmote
. Both can be parsed from this parser. However, the parameter implementation will have to beIEmote
as well, regardless of the underlying type.
*** The
UInt64
(ulong) converter is introduced because theInt64
(number) parameter from discord does not support unsigned positive characters up to the height of Discord snowflake ID's.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Discord.Net.Interactions (>= 3.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release 1.2.1, Supporting Discord.Net 3.6.1+