Merge pull request #407 from 13xforever/vnext

Misc fixes
This commit is contained in:
Ilya 2019-09-16 21:59:59 +05:00 committed by GitHub
commit bd42e4d6a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ namespace CompatBot.Commands
new AsciiColumn("By", maxWidth: 15),
new AsciiColumn("On date (UTC)"),
new AsciiColumn("Reason"),
new AsciiColumn("Context", disabled: !isPrivate)
new AsciiColumn("Context", disabled: !isPrivate, maxWidth: 4096)
);
IQueryable<Warning> query = db.Warning.Where(w => w.DiscordId == userId).OrderByDescending(w => w.Id);
if (!isPrivate || !isWhitelisted)

View File

@ -18,7 +18,7 @@ namespace CompatBot.Database.Providers
public static async Task<bool> IsWhitelistedAsync(DiscordInvite invite)
{
var code = invite.IsTemporary || string.IsNullOrWhiteSpace(invite.Code) ? null : invite.Code;
var code = string.IsNullOrWhiteSpace(invite.Code) ? null : invite.Code;
var name = string.IsNullOrWhiteSpace(invite.Guild.Name) ? null : invite.Guild.Name;
using (var db = new BotDb())
{
@ -28,7 +28,7 @@ namespace CompatBot.Database.Providers
if (name != null && name != whitelistedInvite.Name)
whitelistedInvite.Name = invite.Guild.Name;
if (code != null && code != whitelistedInvite.InviteCode)
if (string.IsNullOrEmpty(whitelistedInvite.InviteCode) && code != null)
whitelistedInvite.InviteCode = code;
await db.SaveChangesAsync().ConfigureAwait(false);
return true;
@ -40,7 +40,7 @@ namespace CompatBot.Database.Providers
if (await IsWhitelistedAsync(invite).ConfigureAwait(false))
return false;
var code = invite.IsTemporary || string.IsNullOrWhiteSpace(invite.Code) ? null : invite.Code;
var code = invite.IsRevoked || string.IsNullOrWhiteSpace(invite.Code) ? null : invite.Code;
var name = string.IsNullOrWhiteSpace(invite.Guild.Name) ? null : invite.Guild.Name;
using (var db = new BotDb())
{