Cenk Ergen e8c5436c40 [Feature] Modal Select Components Support for IF (#3189)
* add interaction service attributes new modal input types

* add new modal component type converters

* relocate hide attribute outside of slash command enum converter for general purpose use

* refactor base inputcomponentbuilder types to use modal component typeconverters

* add builders for new modal input types

* add component insertion methods to modal builder for new input types

* refactor base inputcomponentinfo class to use modal component typeconverters

* add component info classes for newly added modal input types

* add build logic for new modal input metadata classes

* add componet collection properties for new modal input types to modalinfo

* implement convertion logic for new modal inputs to the respond with modal extension methods

* implement modal input typeconverters into interaction service

* add read logic to enum modal component typeconverter

* add default entity modal component typeconverter

* add write logic to default value modal component typeconverter

* add write logic to the nullable modal component typeconverter

* add description property to input label attribute

* add inline docs to modal attributes

* add modal file upload attribute

* add inline docs to input component infos

* add description property to input component builder

* add inline docs to modal component builders

* add modal file upload component info

* add modal file upload component builder

* rename select input attribute

* refactor select input attribute and add description property in moduleClassBuilder

* add inline docs to modalBuilder

* add description to inputComponentInfo

* file-scope namespace for commandBuilder and modal interfaces

* update respondWithModal logic to include new components

* add inline docs and file upload component to modalInfo

* add attachment modal typeconverter

* create base non-input modal component entities

* update modal component typeconverter namespaces and remove unused

* add default min/max values to select input attribute

* create text display builder and info classes

* add text display parsing logic

* add text display attribute

* add modal select menu option attribute

* add docs to text display component info

* fix text display parsing

* add isRequired mapping to select menus

* revert to block-scope to clear diff false-positives

* fix inline doc annotations

* fix build errors

* add interaction parameter to modal component typeconverter write method

* add null check to select menu option attribute

* add null check to default value modalTypeConverter write method

* make ctors of modal component base attributes internal

* implement predicate to hide attribute and enum modalcomponent typeconverter

* fix HideAttribute inline docs build errors

* simplify naming of the component classes and normalize namespaces

* fix build errors in module class builder

* add inline docs to modalComponentTypeConverter TryGetModalInteractionData

* add min/max values parameters to ModalChannelSelectAttribute

* fix defaultArrayModalTypeConverter chanell type write logic

* simplify addDefaultValue methods for channe, mentionable, role, and user selects

* add emoji support to select menu options

* add instance value parsing to enum modalComponentConverter
2025-11-24 21:08:05 +03:00
2021-11-24 12:53:39 -04:00
2018-01-06 22:30:04 -05:00
2015-08-09 11:36:55 -03:00
2022-04-04 18:19:44 -03:00
2025-07-20 00:16:31 +03:00
2024-01-11 22:29:37 +03:00
2024-10-12 21:48:56 +00:00

Discord.Net is an unofficial .NET API Wrapper for the Discord API (https://discord.com).

📄 Documentation

Documentation can be found at https://docs.discordnet.dev/index.html

🩷 Supporting Discord.Net

Discord.Net is an MIT-licensed open source project with its development made possible entirely by volunteers. If you'd like to support our efforts financially, please consider:

📥 Installation

Stable (NuGet)

Our stable builds available from NuGet through the Discord.Net metapackage:

The individual components may also be installed from NuGet:

Nightlies

Nightlies are builds of Discord.NET that are still in an experimental phase, and have not been released.
They are available through 2 different sources:

Note

GitHub Packages requires authentication. You can find more information here.

🛑 Known Issues

WebSockets (Win7 and earlier)

.NET Core 1.1 does not support WebSockets on Win7 and earlier. This issue has been fixed since the release of .NET Core 2.1. It is recommended to target .NET Core 2.1 or above for your project if you wish to run your bot on legacy platforms; alternatively, you may choose to install the Discord.Net.Providers.WS4Net package.

TLS on .NET Framework.

Discord supports only TLS1.2+ on all their websites including the API since 07/19/2022. .NET Framework does not support this protocol by default. If you depend on .NET Framework, it is suggested to upgrade your project to net6-windows. This framework supports most of the windows-only features introduced by fx, and resolves startup errors from the TLS protocol mismatch.

🗃️ Versioning Guarantees

This library generally abides by Semantic Versioning. Packages are published in MAJOR.MINOR.PATCH version format.

Patch component

An increment of the PATCH component always indicates that an internal-only change was made, generally a bugfix. These changes will not affect the public-facing API in any way, and are always guaranteed to be forward- and backwards-compatible with your codebase, any pre-compiled dependencies of your codebase.

Minor component

An increment of the MINOR component indicates that some addition was made to the library, and this addition is not backwards-compatible with prior versions. However, Discord.Net does not guarantee forward-compatibility on minor additions. In other words, we permit a limited set of breaking changes on a minor version bump.

Due to the nature of the Discord API, we will oftentimes need to add a property to an entity to support the latest API changes. Discord.Net provides interfaces as a method of consuming entities; and as such, introducing a new field to an entity is technically a breaking change. Major version bumps generally indicate some major change to the library, and as such we are hesitant to bump the major version for every minor addition to the library. To compromise, we have decided that interfaces should be treated as consumable only, and your applications should typically not be implementing interfaces.

For applications where interfaces are implemented, such as in test mocks, we apologize for this inconsistency with SemVer.

While we will never break the API (outside of interface changes) on minor builds, we will occasionally need to break the ABI, by introducing parameters to a method to match changes upstream with Discord. As such, a minor version increment may require you to recompile your code, and dependencies, such as addons, may also need to be recompiled and republished on the newer version. When a binary breaking change is made, the change will be noted in the release notes.

Major component

An increment of the MAJOR component indicates that breaking changes have been made to the library; consumers should check the release notes to determine what changes need to be made.

📚 Branches

Release/X.X

Release branch following Major.Minor. Upon release, patches will be pushed to these branches. New NuGet releases will be tagged on these branches.

Dev

Development branch, available on MyGet. This branch is what pull requests are targetted to.

Feature/X

Branches that target Dev, adding new features. Feel free to explore these branches and give feedback where necessary.

Docs/X

Usually targets Dev. These branches are used to update documentation with either new features or existing feature rework.

Languages
C# 100%