diff --git a/CompatBot/Commands/Misc.cs b/CompatBot/Commands/Misc.cs index 2edc2f0c..1ac0e517 100644 --- a/CompatBot/Commands/Misc.cs +++ b/CompatBot/Commands/Misc.cs @@ -282,28 +282,27 @@ namespace CompatBot.Commands else if (i == 0 && await new DiscordMemberConverter().ConvertAsync(word, ctx).ConfigureAwait(false) is Optional member && member.HasValue) { var m = member.Value; - MakeCustomRoleRating(m); + if (suffix.Length == 0) + MakeCustomRoleRating(m); result.Append(m.Mention); } else if (nekoMatch.Contains(word)) { - if (!choiceFlags.Contains('n')) + if (i == 0 && suffix.Length == 0) { choices = RateAnswers.Concat(Enumerable.Repeat("Ugh", RateAnswers.Count * 3)).ToList(); - choiceFlags.Add('n'); + MakeCustomRoleRating(nekoMember); } - MakeCustomRoleRating(nekoMember); result.Append(nekoUser.Mention); } else if (kdMatch.Contains(word)) { - if (!choiceFlags.Contains('k')) + if (i == 0 && suffix.Length == 0) { choices = RateAnswers.Concat(Enumerable.Repeat("RSX genius", RateAnswers.Count * 3)).ToList(); - choiceFlags.Add('k'); + MakeCustomRoleRating(kdMember); } - MakeCustomRoleRating(kdMember); result.Append(kdUser.Mention); } else @@ -319,10 +318,16 @@ namespace CompatBot.Commands whatever = whatever.Substring("rate ".Length); if (whatever == "sonic" || whatever.Contains("sonic the")) choices = RateAnswers.Concat(Enumerable.Repeat("💩 out of 🦔", RateAnswers.Count)).Concat(new[] {"Sonic out of 🦔", "Sonic out of 10"}).ToList(); - var seed = (prefix + whatever).GetHashCode(StringComparison.CurrentCultureIgnoreCase); - var seededRng = new Random(seed); - var answer = choices[seededRng.Next(choices.Count)]; - await ctx.RespondAsync(answer).ConfigureAwait(false); + + if (string.IsNullOrEmpty(whatever)) + await ctx.RespondAsync("Rating nothing makes _**so much**_ sense, right?").ConfigureAwait(false); + else + { + var seed = (prefix + whatever).GetHashCode(StringComparison.CurrentCultureIgnoreCase); + var seededRng = new Random(seed); + var answer = choices[seededRng.Next(choices.Count)]; + await ctx.RespondAsync(answer).ConfigureAwait(false); + } } catch (Exception e) {