Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make the extensions disposable
  • Loading branch information
akiraveliara committed Jul 31, 2024
commit 154a3f564f314e9e24b2e2d1c84e521f272f4a2d
2 changes: 1 addition & 1 deletion DSharpPlus.CommandsNext/CommandsNextExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace DSharpPlus.CommandsNext;
/// <summary>
/// This is the class which handles command registration, management, and execution.
/// </summary>
public class CommandsNextExtension
public class CommandsNextExtension : IDisposable
{
private CommandsNextConfiguration Config { get; }
private HelpFormatterFactory HelpFormatter { get; }
Expand Down
2 changes: 1 addition & 1 deletion DSharpPlus.Interactivity/InteractivityExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace DSharpPlus.Interactivity;
/// <summary>
/// Extension class for DSharpPlus.Interactivity
/// </summary>
public class InteractivityExtension
public class InteractivityExtension : IDisposable
{
internal readonly ConcurrentDictionary<Type, AsyncEvent> eventDistributor = [];
internal IClientErrorHandler errorHandler;
Expand Down
2 changes: 1 addition & 1 deletion DSharpPlus.VoiceNext/VoiceNextExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace DSharpPlus.VoiceNext;
/// <summary>
/// Represents VoiceNext extension, which acts as Discord voice client.
/// </summary>
public sealed class VoiceNextExtension
public sealed class VoiceNextExtension : IDisposable
{
private VoiceNextConfiguration Configuration { get; set; }

Expand Down
5 changes: 2 additions & 3 deletions DSharpPlus/Clients/DefaultEventDispatcher.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

using DSharpPlus.EventArgs;
Expand All @@ -10,8 +10,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

using Handler = System.Func<DSharpPlus.DiscordClient, DSharpPlus.EventArgs.DiscordEventArgs, System.IServiceProvider, System.Threading.Tasks.Task>;

namespace DSharpPlus.Clients;

/// <summary>
Expand Down Expand Up @@ -40,6 +38,7 @@ ILogger<IEventDispatcher> logger
}

/// <inheritdoc/>
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder))]
public ValueTask DispatchAsync<T>(DiscordClient client, T eventArgs)
Comment thread
Naamloos marked this conversation as resolved.
where T : DiscordEventArgs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace DSharpPlus.SlashCommands;
/// A class that handles slash commands for a client.
/// </summary>
[Obsolete("DSharpPlus.SlashCommands is obsolete. Please consider using the new DSharpPlus.Commands extension instead.")]
public sealed partial class SlashCommandsExtension
public sealed partial class SlashCommandsExtension : IDisposable
{
//A list of methods for top level commands
private static List<CommandMethod> commandMethods { get; set; } = [];
Expand Down