public async Task RKill(CommandContext ctx) { Console.WriteLine(DateTime.Now.ToString("[HH:mm:ss] ", CultureInfo.CreateSpecificCulture("en-GB")) + "RKill Command"); string args; string author = ctx.Member.DisplayName; List <string> listU = Useful.GetOnlineNames(ctx.Channel.Guild); try { args = ctx.Message.Content.Split(new char[] { ' ' }, 2)[1]; } catch (IndexOutOfRangeException) { args = string.Empty; } KillUser.KillResult result = KillUser.KillRandom(args, author, listU); switch (result.IsAction) { case true: await ctx.RespondAsync("*" + result.Result.Trim() + "*").ConfigureAwait(false); break; case false: await ctx.RespondAsync(result.Result).ConfigureAwait(false); break; } }
public async Task Kill(CommandContext ctx, [RemainingText] string arg) { logger.Info("Kill Command", Useful.GetDiscordName(ctx)); KillUser.KillResult result = KillUser.Kill(Useful.GetUsername(ctx), Useful.GetOnlineNames(ctx.Channel.Guild), arg); switch (result.IsAction) { case true: await ctx.RespondAsync("*" + result.Result + "*").ConfigureAwait(false); break; case false: await ctx.RespondAsync(result.Result).ConfigureAwait(false); break; } }
public async Task RandomKill(CommandContext ctx) { logger.Info("rkill Command", Useful.GetDiscordName(ctx)); KillUser.KillResult result = KillUser.KillRandom(Useful.GetUsername(ctx), Useful.GetOnlineNames(ctx.Channel.Guild)); switch (result.IsAction) { case true: await ctx.RespondAsync("*" + result.Result.Trim() + "*").ConfigureAwait(false); break; case false: await ctx.RespondAsync(result.Result).ConfigureAwait(false); break; } }