mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-11-03 08:14:28 -05:00
Updated creds_example.yml, fixed some async compilation warnings
This commit is contained in:
@@ -96,7 +96,7 @@ Windows default
|
|||||||
|
|
||||||
public Creds()
|
public Creds()
|
||||||
{
|
{
|
||||||
Version = 1;
|
Version = 3;
|
||||||
Token = string.Empty;
|
Token = string.Empty;
|
||||||
OwnerIds = new List<ulong>();
|
OwnerIds = new List<ulong>();
|
||||||
TotalShards = 1;
|
TotalShards = 1;
|
||||||
|
|||||||
@@ -147,10 +147,10 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ImageData?> GenerateSparklineAsync(IReadOnlyCollection<CandleData> series)
|
public Task<ImageData?> GenerateSparklineAsync(IReadOnlyCollection<CandleData> series)
|
||||||
{
|
{
|
||||||
if (series.Count == 0)
|
if (series.Count == 0)
|
||||||
return default;
|
return Task.FromResult<ImageData?>(default);
|
||||||
|
|
||||||
using var image = CreateCanvasInternal();
|
using var image = CreateCanvasInternal();
|
||||||
|
|
||||||
@@ -161,13 +161,13 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
|
|||||||
ctx.DrawLines(_sparklineColor, 2, points);
|
ctx.DrawLines(_sparklineColor, 2, points);
|
||||||
});
|
});
|
||||||
|
|
||||||
return new("png", image.ToStream());
|
return Task.FromResult<ImageData?>(new("png", image.ToStream()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ImageData?> GenerateCombinedChartAsync(IReadOnlyCollection<CandleData> series)
|
public Task<ImageData?> GenerateCombinedChartAsync(IReadOnlyCollection<CandleData> series)
|
||||||
{
|
{
|
||||||
if (series.Count == 0)
|
if (series.Count == 0)
|
||||||
return default;
|
return Task.FromResult<ImageData?>(default);
|
||||||
|
|
||||||
using var image = CreateCanvasInternal();
|
using var image = CreateCanvasInternal();
|
||||||
|
|
||||||
@@ -182,13 +182,13 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
|
|||||||
ctx.DrawLines(Color.ParseHex("00FFFFAA"), 1, points);
|
ctx.DrawLines(Color.ParseHex("00FFFFAA"), 1, points);
|
||||||
});
|
});
|
||||||
|
|
||||||
return new("png", image.ToStream());
|
return Task.FromResult<ImageData?>(new("png", image.ToStream()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ImageData?> GenerateCandleChartAsync(IReadOnlyCollection<CandleData> series)
|
public Task<ImageData?> GenerateCandleChartAsync(IReadOnlyCollection<CandleData> series)
|
||||||
{
|
{
|
||||||
if (series.Count == 0)
|
if (series.Count == 0)
|
||||||
return default;
|
return Task.FromResult<ImageData?>(default);
|
||||||
|
|
||||||
using var image = CreateCanvasInternal();
|
using var image = CreateCanvasInternal();
|
||||||
|
|
||||||
@@ -197,6 +197,6 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
|
|||||||
var drawData = GetChartDrawingDataInternal(series);
|
var drawData = GetChartDrawingDataInternal(series);
|
||||||
DrawChartData(image, drawData);
|
DrawChartData(image, drawData);
|
||||||
|
|
||||||
return new("png", image.ToStream());
|
return Task.FromResult<ImageData?>(new("png", image.ToStream()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,9 +121,9 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
|||||||
if (File.Exists(CREDS_FILE_NAME))
|
if (File.Exists(CREDS_FILE_NAME))
|
||||||
{
|
{
|
||||||
var creds = Yaml.Deserializer.Deserialize<Creds>(File.ReadAllText(CREDS_FILE_NAME));
|
var creds = Yaml.Deserializer.Deserialize<Creds>(File.ReadAllText(CREDS_FILE_NAME));
|
||||||
if (creds.Version <= 1)
|
if (creds.Version <= 2)
|
||||||
{
|
{
|
||||||
creds.Version = 2;
|
creds.Version = 3;
|
||||||
File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds));
|
File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# DO NOT CHANGE
|
# DO NOT CHANGE
|
||||||
version: 1
|
version: 3
|
||||||
# Bot token. Do not share with anyone ever -> https://discordapp.com/developers/applications/
|
# Bot token. Do not share with anyone ever -> https://discordapp.com/developers/applications/
|
||||||
token: ''
|
token: ''
|
||||||
# List of Ids of the users who have bot owner permissions
|
# List of Ids of the users who have bot owner permissions
|
||||||
@@ -65,6 +65,13 @@ timezoneDbApiKey:
|
|||||||
coinmarketcapApiKey:
|
coinmarketcapApiKey:
|
||||||
# Api key used for Osu related commands. Obtain this key at https://osu.ppy.sh/p/api
|
# Api key used for Osu related commands. Obtain this key at https://osu.ppy.sh/p/api
|
||||||
osuApiKey:
|
osuApiKey:
|
||||||
|
# Optional Trovo client id.
|
||||||
|
# You should use this if Trovo stream notifications stopped working or you're getting ratelimit errors.
|
||||||
|
trovoClientId:
|
||||||
|
# Obtain by creating an application at https://dev.twitch.tv/console/apps
|
||||||
|
twitchClientId:
|
||||||
|
# Obtain by creating an application at https://dev.twitch.tv/console/apps
|
||||||
|
twitchClientSecret:
|
||||||
# Command and args which will be used to restart the bot.
|
# Command and args which will be used to restart the bot.
|
||||||
# Only used if bot is executed directly (NOT through the coordinator)
|
# Only used if bot is executed directly (NOT through the coordinator)
|
||||||
# placeholders:
|
# placeholders:
|
||||||
@@ -74,8 +81,8 @@ osuApiKey:
|
|||||||
# cmd: dotnet
|
# cmd: dotnet
|
||||||
# args: "NadekoBot.dll -- {0}"
|
# args: "NadekoBot.dll -- {0}"
|
||||||
# Windows default
|
# Windows default
|
||||||
# cmd: "NadekoBot.exe"
|
# cmd: NadekoBot.exe
|
||||||
# args: "{0}"
|
# args: {0}
|
||||||
restartCommand:
|
restartCommand:
|
||||||
cmd:
|
cmd:
|
||||||
args:
|
args:
|
||||||
|
|||||||
Reference in New Issue
Block a user