2022-11-27 20:43:21 +00:00
|
|
|
|
namespace VpSharp.Commands;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Extension methods for <see cref="VirtualParadiseClient" />.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class VirtualParadiseClientExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Registers <see cref="CommandsExtension" /> to be used with the current client.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client">The <see cref="VirtualParadiseClient" />.</param>
|
|
|
|
|
/// <param name="configuration">The configuration required for the extensions.</param>
|
|
|
|
|
/// <returns>The commands extension instance.</returns>
|
2022-11-30 18:16:37 +00:00
|
|
|
|
/// <exception cref="ArgumentNullException"><paramref name="client" /> is <see langword="null" />.</exception>
|
2022-11-27 20:43:21 +00:00
|
|
|
|
public static CommandsExtension UseCommands(this VirtualParadiseClient client, CommandsExtensionConfiguration configuration)
|
|
|
|
|
{
|
2024-02-15 22:38:48 +00:00
|
|
|
|
if (client is null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(client));
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-27 20:43:21 +00:00
|
|
|
|
return client.AddExtension<CommandsExtension>(configuration);
|
|
|
|
|
}
|
|
|
|
|
}
|