Skip to content

v1.8

Latest
Compare
Choose a tag to compare
@d4n3436 d4n3436 released this 20 Sep 17:40

Additions

  • Added the .NET 8 target framework.

  • Added IsManaged() methods to InteractiveService. 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() and TryGetSelection() methods to InteractiveService. These methods allow to retrieve a paginator or selection from a message or message ID.

  • Added the TriggersAnyFilter() method to InteractiveService. Similar to IsManaged(), 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 the Next{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() and WithRestrictedPageFactory() methods on paginator/selection builders). In this case, the page is sent to the user as an ephemeral message.
    The WithDefaultRestrictedPage() 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. A Values property has been added to InteractiveResult<T> (which InteractiveMessageResult<T> inherits from) to access the selected values.

  • Added MenuSelection and MenuSelectionBuilder. A MenuSelection 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 doing collection.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. Now TOption on InteractiveMessageResult<TOption> is no longer nullable because the result can return multiple non-null values.

Removals

  • Removed the deprecated constructors and properties of InteractiveService.