Skip to content

Commit 2ee8437

Browse files
committed
chore: Apply IDE suggestions
1 parent ff2cef3 commit 2ee8437

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

DockerDiscordBot/Commands/Help/HelpCommandHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public sealed class HelpCommandHandler : IRequestHandler<HelpCommand>
1414

1515
public HelpCommandHandler(
1616
ILogger<HelpCommandHandler> logger,
17-
IOptions<ApplicationSettings> _options)
17+
IOptions<ApplicationSettings> options)
1818
{
1919
_logger = logger;
20-
_commandPrefix = _options.Value.CommandPrefix;
20+
_commandPrefix = options.Value.CommandPrefix;
2121
}
2222

2323
public async Task Handle(HelpCommand request, CancellationToken cancellationToken)

DockerDiscordBot/Extensions/CommandsExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public static class CommandsExtensions
1313
return null;
1414
}
1515

16-
var command = message.Content.Substring(1).Split(' ')[0];
16+
var command = message.Content.Substring(1).Split(' ').FirstOrDefault();
1717

18-
if (!CommandMapping.Commands.ContainsKey(command))
18+
if (command is null || !CommandMapping.Commands.ContainsKey(command))
1919
{
2020
return null;
2121
}

0 commit comments

Comments
 (0)