Interactivity reorganization and improvement.
Created by: Giggitybyte
Summary
The primary goal of this PR is to clean up and improve extension methods, enums, and return types from DSharpPlus.Interactivity
.
Details
In addition to some other minor clean up, all extension methods and enums have been gathered into one place to allow for easier maintenance and readability. A few quality of life improvements have been made as well.
Changes proposed
-
Improve extension methods.
- All extension methods are now under the new Extensions namespace.
- All extensions with a single awaitable statement now pass their task through instead of
await
ing. - Improved XML docs for all extension methods.
- Improved variable naming for all extension methods.
- Added missing null checks.
- Config parameter for
UseInteractivity
is now optional. - Config parameter for
UseInteractivityAsync
is now optional. - The aforementioned extensions will now create a default
InteractivityConfiguration
instance if none is provided.
-
Improve enums.
- Moved
PaginationDeletion
from PaginationBehaviour.cs into its own file. - Moved
SplitType
from InteractivityExtension.cs into its own file under the Enum namespace. - Removed unnecessary
Flags
attribute onPollBehaviour
. - Improved XML documentation for all enums.
- Moved
-
Remove Concurrency namespace.
- Deleted
ConcurrentHashSet
- Deleted
PlatformHelper
- Replaced the above with a NuGet package which contains the exact same types from the original author.
- Deleted
-
Replace all array types with an
IEnumerable<>
equivalent.-
pages
parameter ofSendPaginatedMessageAsync
is now of typeIEnumerable<Page>
instead ofPage[]
. -
emojis
parameter ofDoPollAsync
is now of typeIEnumerable<DiscordEmoji>
instead ofDiscordEmoji[]
. -
GeneratePagesInString
now returnsIEnumerable<Page>
instead ofPage[]
. -
GeneratePagesInEmbed
now returnsIEnumerable<Page>
instead ofPage[]
.
-
Hopefully I haven't missed anything.
Notes
There's more that could be improved, but I wanted to avoid any major breaking changes with this PR. Perhaps after 4.0 releases, I'll PR those additional changes.