public async Task Choose(CommandContext ctx, [RemainingText] string args)
        {
            logger.Info("Choose Command", Useful.GetDiscordName(ctx));

            try
            {
                string arg    = args.Trim().Replace("  ", " ", StringComparison.OrdinalIgnoreCase);
                string result = Basics.Choose(arg, Useful.GetUsername(ctx));
                await ctx.RespondAsync(result).ConfigureAwait(false);
            }
            catch (IndexOutOfRangeException)
            {
                return;
            }
        }
Exemple #2
0
        public async Task Choose(CommandContext ctx)
        {
            Console.WriteLine(DateTime.Now.ToString("[HH:mm:ss] ", CultureInfo.CreateSpecificCulture("en-GB")) + "Choose Command");

            string arg;
            string user = ctx.Member.DisplayName;

            try
            {
                arg = ctx.Message.Content.Split(new char[] { ' ' }, 2)[1].Trim().Replace("  ", " ", StringComparison.OrdinalIgnoreCase);
                string result = Basics.Choose(arg, user);
                await ctx.RespondAsync(result).ConfigureAwait(false);
            }
            catch (IndexOutOfRangeException)
            {
                return;
            }
        }