mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Ignore invalid colors in member card
This commit is contained in:
parent
4d2c843442
commit
4e69531103
1 changed files with 13 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -69,7 +70,18 @@ namespace PluralKit.Bot {
|
|||
var name = member.Name;
|
||||
if (system.Name != null) name = $"{member.Name} ({system.Name})";
|
||||
|
||||
var color = member.Color?.ToDiscordColor() ?? Color.Default;
|
||||
Color color;
|
||||
try
|
||||
{
|
||||
color = member.Color?.ToDiscordColor() ?? Color.Default;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// Bad API use can cause an invalid color string
|
||||
// TODO: fix that in the API
|
||||
// for now we just default to a blank color, yolo
|
||||
color = Color.Default;
|
||||
}
|
||||
|
||||
var messageCount = await _members.MessageCount(member);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue