Skip to content

Commit

Permalink
Respect the configs command prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Plerx2493 committed Jul 8, 2024
1 parent 379fb1c commit c0c7766
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
using System.Diagnostics;
using DSharpPlus;
using DSharpPlus.Commands;
using DSharpPlus.Commands.Processors.TextCommands;
using DSharpPlus.Commands.Processors.TextCommands.Parsing;
using DSharpPlus.Entities;
using DSharpPlus.Interactivity;
using DSharpPlus.Interactivity.Enums;
Expand Down Expand Up @@ -43,7 +45,8 @@ public class DiscordCommandService : IHostedService
public DiscordCommandService
(
DiscordClient discordClient,
IDbContextFactory<MadsContext> dbContextFactory
IDbContextFactory<MadsContext> dbContextFactory,
MadsConfig config
)
{
DiscordClient = discordClient;
Expand All @@ -66,6 +69,10 @@ IDbContextFactory<MadsContext> dbContextFactory
#endif
};
Commands = DiscordClient.UseCommands(commandsConfiguration);
Commands.AddProcessorsAsync(new TextCommandProcessor(new TextCommandConfiguration()
{
PrefixResolver = new DefaultPrefixResolver(true, config.Prefix).ResolvePrefixAsync
}));
Commands.AddCommands(commandTypes);
Commands.AddCheck<EnsureDBEntitiesCheck>();
Commands.AddCheck<RequireOwnerCheck>();
Expand Down

0 comments on commit c0c7766

Please sign in to comment.