Skip to content

Interactivity reorganization and improvement.

Mateusz Brawański requested to merge github/fork/Giggitybyte/master into master

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 awaiting.
    • 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 on PollBehaviour.
    • Improved XML documentation for all enums.
  • Remove Concurrency namespace.

    • Deleted ConcurrentHashSet
    • Deleted PlatformHelper
    • Replaced the above with a NuGet package which contains the exact same types from the original author.
  • Replace all array types with an IEnumerable<> equivalent.

    • pages parameter of SendPaginatedMessageAsync is now of type IEnumerable<Page> instead of Page[].
    • emojis parameter of DoPollAsync is now of type IEnumerable<DiscordEmoji> instead of DiscordEmoji[].
    • GeneratePagesInString now returns IEnumerable<Page> instead of Page[].
    • GeneratePagesInEmbed now returns IEnumerable<Page> instead of Page[].

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.

Merge request reports

Loading