allow decoding product codes without numbers again

This commit is contained in:
13xforever 2020-01-14 21:15:39 +05:00
parent 9be3dfe0c2
commit 02b7a973e1

View File

@ -450,8 +450,9 @@ namespace CompatBot.Commands
[Description("Describe Playstation product code")]
public async Task ProductCode(CommandContext ctx, [RemainingText, Description("Product code such as BLUS12345 or SCES")] string productCode)
{
productCode = ProductCodeLookup.GetProductIds(productCode).FirstOrDefault()?.ToUpperInvariant();
if (productCode?.Length > 4)
productCode = ProductCodeLookup.GetProductIds(productCode).FirstOrDefault() ?? productCode;
productCode = productCode?.ToUpperInvariant();
if (productCode?.Length > 3)
{
var dsc = ProductCodeDecoder.Decode(productCode);
var info = string.Join('\n', dsc);