Merge pull request #470 from 13xforever/vnext

Fix some issues
This commit is contained in:
Ilya 2019-11-25 22:29:54 +05:00 committed by GitHub
commit 3be9d1b603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 16 deletions

View File

@ -216,24 +216,23 @@ namespace CompatBot.Commands
}
if (count == 0)
{
if (removed == 0)
if (isKot && isDoggo)
{
if (isKot && isDoggo)
{
if (new Random().NextDouble() < 0.5)
isKot = false;
else
isDoggo = false;
}
if (isKot)
await message.RespondAsync($"{userName} has no warnings, is an upstanding kot, and a paw bean of this community").ConfigureAwait(false);
else if (isDoggo)
await message.RespondAsync($"{userName} has no warnings, is a good boy, and a wiggling tail of this community").ConfigureAwait(false);
if (new Random().NextDouble() < 0.5)
isKot = false;
else
await message.RespondAsync($"{userName} has no warnings, is an upstanding citizen, and a pillar of this community").ConfigureAwait(false);
isDoggo = false;
}
else
await message.RespondAsync(userName + " has no warnings" + (isPrivate ? $" ({removed} retracted warning{(removed == 1 ? "" : "s")})" : "")).ConfigureAwait(false);
var msg = (removed, isKot, isDoggo) switch
{
(0, true, false) => $"{userName} has no warnings, is an upstanding kot, and a paw bean of this community",
(0, false, true) => $"{userName} has no warnings, is a good boy, and a wiggling tail of this community",
(0, _, _) => $"{userName} has no warnings, is an upstanding citizen, and a pillar of this community",
(_, true, false) => $"{userName} has no warnings{(isPrivate ? $" ({removed} retracted warning{(removed == 1 ? "" : "s")}), but are they a good kot?" : "")}",
(_, false, true) => $"{userName} has no warnings{(isPrivate ? $" ({removed} retracted warning{(removed == 1 ? "" : "s")}), but are they a good boy?" : "")}",
_ => $"{userName} has no warnings{(isPrivate ? $" ({removed} retracted warning{(removed == 1 ? "" : "s")})" : "")}",
};
await message.RespondAsync(msg).ConfigureAwait(false);
return;
}

View File

@ -118,6 +118,8 @@ namespace CompatBot.Database.Providers
try
{
await message.Channel.DeleteMessageAsync(message, $"Removed according to filter '{trigger}'").ConfigureAwait(false);
var author = client.GetMember(message.Author);
Config.Log.Debug($"Removed message from {author.GetMentionWithNickname()} in #{message.Channel.Name}: {message.Content}");
completedActions.Add(FilterAction.RemoveContent);
}
catch

View File

@ -512,7 +512,7 @@ namespace CompatBot.Utils.ResultFormatters
builder.AddField("Missing Licenses", content);
var gameRegion = items["serial"] is string serial && serial.Length > 3 ? new[] {serial[2]} : Enumerable.Empty<char>();
var dlcRegions = licenseNames.Select(n => n[2]).Concat(gameRegion).Distinct().ToArray();
var dlcRegions = licenseNames.Select(n => n[9]).Concat(gameRegion).Distinct().ToArray();
if (dlcRegions.Length > 1)
generalNotes.Add($"🤔 Very interesting DLC collection from {dlcRegions.Length} different regions you got there");
}