.stock now shows a candlestick chart with a sparkline on top of it. Reorganized stock code slightly

This commit is contained in:
Kwoth
2022-02-07 17:50:25 +01:00
parent 22eabff276
commit 0008eabdd2
21 changed files with 334 additions and 99 deletions

View File

@@ -5,18 +5,16 @@ namespace NadekoBot.Common.TypeReaders;
public sealed class Rgba32TypeReader : NadekoTypeReader<Color>
{
public override async ValueTask<TypeReaderResult<Color>> ReadAsync(ICommandContext context, string input)
public override ValueTask<TypeReaderResult<Color>> ReadAsync(ICommandContext context, string input)
{
await Task.Yield();
input = input.Replace("#", "", StringComparison.InvariantCulture);
try
{
return TypeReaderResult.FromSuccess(Color.ParseHex(input));
return ValueTask.FromResult(TypeReaderResult.FromSuccess(Color.ParseHex(input)));
}
catch
{
return TypeReaderResult.FromError<Color>(CommandError.ParseFailed, "Parameter is not a valid color hex.");
return ValueTask.FromResult(TypeReaderResult.FromError<Color>(CommandError.ParseFailed, "Parameter is not a valid color hex."));
}
}
}