Additions
-
Added the .NET 8 target framework.
-
Added
IsManaged()
methods toInteractiveService
. These methods allow to determine whether an interaction should be handled by the library, or if a message is managed by an active paginator or selection. -
Added
TryGetPaginator()
andTryGetSelection()
methods toInteractiveService
. These methods allow to retrieve a paginator or selection from a message or message ID. -
Added the
TriggersAnyFilter()
method toInteractiveService
. Similar toIsManaged()
, it allows you to determine whether an incoming object (such as a message, reaction or interaction) triggers at least one of the filters registered by theNext{Entity}Async()
methods. -
Added support for restricted pages and changing the behavior of paginators/selections on restricted inputs. A restricted input is one that comes from a user who is not allowed to interact with the paginator or selection. The default behavior is to simply ignore the input unless a restricted page is present (via the
WithRestrictedPage()
andWithRestrictedPageFactory()
methods on paginator/selection builders). In this case, the page is sent to the user as an ephemeral message.
TheWithDefaultRestrictedPage()
extension method has been added to provide a ready-to-use restricted page with a generic message. -
Added support for selecting multiple options on selections. 2 new properties (
MinValues
,MaxValues
) and 2 new methods have been added to control the minimum and maximum number of items a user can select. AValues
property has been added toInteractiveResult<T>
(whichInteractiveMessageResult<T>
inherits from) to access the selected values. -
Added
MenuSelection
andMenuSelectionBuilder
. AMenuSelection
is a selection whose options can be selected multiple times and uses a delegate (InputHandler
) to dynamically change the page it's currently displaying. -
Added support for setting the placeholder text of selections that use select menus.
-
Added an overload of
LazyPaginatorBuilder.WithMaxPagesIndex()
that takes a read-only collection argument as an extension method. It allows to set the maximum page index of a lazy paginator based on the number of items in the collection (instead of doingcollection.Count - 1
).
Changes
- Updated Discord.Net.WebSocket to 3.16.0
- Improved the XML documentation to make the description and usage of classes, properties and methods clearer.
- Modified the nullability of the return value of the
SendSelectionAsync()
methods to reflect its current state. NowTOption
onInteractiveMessageResult<TOption>
is no longer nullable because the result can return multiple non-null values.
Removals
- Removed the deprecated constructors and properties of
InteractiveService
.