More common refactorings like renaming variables, removing empty statements and unused variables, etc

This commit is contained in:
Kwoth
2022-01-09 16:46:08 +01:00
parent 2ce3262d59
commit f07a855912
75 changed files with 447 additions and 465 deletions

View File

@@ -36,7 +36,7 @@ public partial class NSFW : NadekoModule<ISearchImagesService>
}
}
private async Task InternalButts(IMessageChannel Channel)
private async Task InternalButts(IMessageChannel channel)
{
try
{
@@ -47,7 +47,7 @@ public partial class NSFW : NadekoModule<ISearchImagesService>
await http.GetStringAsync($"http://api.obutts.ru/butts/{new NadekoRandom().Next(0, 4335)}"))[0];
}
await Channel.SendMessageAsync($"http://media.obutts.ru/{obj["preview"]}");
await channel.SendMessageAsync($"http://media.obutts.ru/{obj["preview"]}");
}
catch (Exception ex)
{

View File

@@ -35,7 +35,7 @@ public class SearchImagesService : ISearchImagesService, INService
private readonly IHttpClientFactory _httpFactory;
private readonly DbService _db;
private readonly object taglock = new();
private readonly object _taglock = new();
public SearchImagesService(
DbService db,
@@ -188,7 +188,7 @@ public class SearchImagesService : ISearchImagesService, INService
public ValueTask<bool> ToggleBlacklistTag(ulong guildId, string tag)
{
lock (taglock)
lock (_taglock)
{
tag = tag.Trim().ToLowerInvariant();
var blacklistedTags = BlacklistedTags.GetOrAdd(guildId, new HashSet<string>());
@@ -214,7 +214,7 @@ public class SearchImagesService : ISearchImagesService, INService
public ValueTask<string[]> GetBlacklistedTags(ulong guildId)
{
lock (taglock)
lock (_taglock)
{
if (BlacklistedTags.TryGetValue(guildId, out var tags)) return new(tags.ToArray());

View File

@@ -10,7 +10,7 @@ public abstract class ImageDownloader<T> : IImageDownloader
public Booru Booru { get; }
protected readonly HttpClient _http;
protected JsonSerializerOptions _serializerOptions = new()
protected readonly JsonSerializerOptions _serializerOptions = new()
{
PropertyNameCaseInsensitive = true,
NumberHandling = JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString