mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Kotz's editorconfig styles slightly modified. Target typed new usage. Brackets in expressions used for clarity.
This commit is contained in:
@@ -24,11 +24,11 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
||||
private string OldCredsJsonBackupPath => Path.Combine(Directory.GetCurrentDirectory(), "credentials.json.bak");
|
||||
|
||||
|
||||
private Creds _creds = new Creds();
|
||||
private IConfigurationRoot _config;
|
||||
private readonly Creds _creds = new();
|
||||
private readonly IConfigurationRoot _config;
|
||||
|
||||
|
||||
private readonly object reloadLock = new object();
|
||||
private readonly object reloadLock = new();
|
||||
public void Reload()
|
||||
{
|
||||
lock (reloadLock)
|
||||
|
@@ -21,7 +21,7 @@ public class CurrencyService : ICurrencyService, INService
|
||||
}
|
||||
|
||||
private CurrencyTransaction GetCurrencyTransaction(ulong userId, string reason, long amount) =>
|
||||
new CurrencyTransaction
|
||||
new()
|
||||
{
|
||||
Amount = amount,
|
||||
UserId = userId,
|
||||
|
@@ -13,9 +13,9 @@ public class GoogleApiService : IGoogleApiService, INService
|
||||
{
|
||||
private const string SearchEngineId = "018084019232060951019:hs5piey28-e";
|
||||
|
||||
private YouTubeService yt;
|
||||
private UrlshortenerService sh;
|
||||
private CustomsearchService cs;
|
||||
private readonly YouTubeService yt;
|
||||
private readonly UrlshortenerService sh;
|
||||
private readonly CustomsearchService cs;
|
||||
|
||||
public GoogleApiService(IBotCredentials creds, IHttpClientFactory factory)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public class GoogleApiService : IGoogleApiService, INService
|
||||
sh = new(bcs);
|
||||
cs = new(bcs);
|
||||
}
|
||||
private static readonly Regex plRegex = new Regex("(?:youtu\\.be\\/|list=)(?<id>[\\da-zA-Z\\-_]*)", RegexOptions.Compiled);
|
||||
private static readonly Regex plRegex = new("(?:youtu\\.be\\/|list=)(?<id>[\\da-zA-Z\\-_]*)", RegexOptions.Compiled);
|
||||
public async Task<IEnumerable<string>> GetPlaylistIdsByKeywordsAsync(string keywords, int count = 1)
|
||||
{
|
||||
await Task.Yield();
|
||||
|
@@ -67,7 +67,7 @@ public class RedisCache : IDataCache
|
||||
return _db.StringSetAsync("novel_" + key, data, expiry: TimeSpan.FromHours(3));
|
||||
}
|
||||
|
||||
private readonly object timelyLock = new object();
|
||||
private readonly object timelyLock = new();
|
||||
public TimeSpan? AddTimelyClaim(ulong id, int period)
|
||||
{
|
||||
if (period == 0)
|
||||
|
@@ -55,7 +55,7 @@ public class SoundCloudVideo
|
||||
{
|
||||
public string Kind { get; set; } = string.Empty;
|
||||
public long Id { get; set; } = 0;
|
||||
public SoundCloudUser User { get; set; } = new SoundCloudUser();
|
||||
public SoundCloudUser User { get; set; } = new();
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string FullName => User.Name + " - " + Title;
|
||||
public bool? Streamable { get; set; } = false;
|
||||
|
Reference in New Issue
Block a user