// // ServiceCollectionExtensions.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.DependencyInjection; using NosSmooth.LocalClient; using NosSmooth.LocalClient.Extensions; using Remora.Commands.Extensions; namespace NosSmooth.ChatCommands; /// /// Extension methods for . /// public static class ServiceCollectionExtensions { /// /// Adds NosTale commands and the interceptor to execute commands with. /// /// The service collection. /// The prefix for the commands. /// The collection. public static IServiceCollection AddNostaleChatCommands(this IServiceCollection serviceCollection, string prefix = "#") { serviceCollection .Configure((o) => o.Prefix = prefix); return serviceCollection .AddCommands() .Configure(o => o.AllowIntercept = true) .AddSingleton() .AddPacketInterceptor(); } }