mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-12 13:16:44 +00:00
Merge pull request #187 from 13xforever/vnext
I lied. But memes are important
This commit is contained in:
commit
4c97a9b9cd
@ -282,28 +282,27 @@ namespace CompatBot.Commands
|
||||
else if (i == 0 && await new DiscordMemberConverter().ConvertAsync(word, ctx).ConfigureAwait(false) is Optional<DiscordMember> member && member.HasValue)
|
||||
{
|
||||
var m = member.Value;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
result.Append(kdUser.Mention);
|
||||
}
|
||||
else
|
||||
@ -319,11 +318,17 @@ 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();
|
||||
|
||||
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)
|
||||
{
|
||||
Config.Log.Warn(e, $"Failed to rate {whatever}");
|
||||
|
Loading…
Reference in New Issue
Block a user