-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargoCommandHandler.cs
More file actions
34 lines (31 loc) · 1.22 KB
/
Copy pathCargoCommandHandler.cs
File metadata and controls
34 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using RustPlusBot.Abstractions.Connections;
using RustPlusBot.Abstractions.Time;
using RustPlusBot.Features.Commands.Dispatching;
using RustPlusBot.Features.Events.State;
using RustPlusBot.Localization;
using RustPlusBot.Persistence.Map;
namespace RustPlusBot.Features.Commands.Handlers;
/// <summary>!cargo — reports the cargo ship's current grid position, if any.</summary>
/// <param name="state">The live event state.</param>
/// <param name="localizer">The reply localizer.</param>
/// <param name="clock">For "how long ago".</param>
/// <param name="mapSettings">Supplies the server's grid style.</param>
internal sealed class CargoCommandHandler(
IEventState state,
ILocalizer localizer,
IClock clock,
IMapSettingsStore mapSettings)
: ICommandHandler
{
/// <inheritdoc />
public string Name => "cargo";
/// <inheritdoc />
public async Task<string?> ExecuteAsync(CommandContext context, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(context);
return await MarkerReply
.ForAsync(state, context, MarkerKind.CargoShip, "command.cargo", localizer, clock, mapSettings,
cancellationToken)
.ConfigureAwait(false);
}
}