diff --git a/src/CS2/Raffle/StartRaffleCommand.cs b/src/CS2/Raffle/StartRaffleCommand.cs index 6b21ada..52e06c6 100644 --- a/src/CS2/Raffle/StartRaffleCommand.cs +++ b/src/CS2/Raffle/StartRaffleCommand.cs @@ -15,14 +15,19 @@ public class StartRaffleCommand(IServiceProvider provider) : ICommand { public string[] RequiredFlags => ["@css/root"]; public string[] Usage => ["", ""]; - public Task Execute(PlayerWrapper? executor, + public async Task Execute(PlayerWrapper? executor, CommandInfoWrapper info) { var amo = 100; if (info.ArgCount == 2) if (!int.TryParse(info.Args[1], out amo)) - return Task.FromResult(CommandResult.PRINT_USAGE); + return CommandResult.PRINT_USAGE; - Server.NextFrame(() => raffle.StartRaffle(amo)); - return Task.FromResult(CommandResult.SUCCESS); + var result = false; + await Server.NextFrameAsync(() => { result = raffle.StartRaffle(amo); }); + + info.ReplySync(result ? + "Raffle started with a prize of $" + amo : + "Raffle already in progress"); + return CommandResult.SUCCESS; } } \ No newline at end of file