mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
More common refactorings like renaming variables, removing empty statements and unused variables, etc
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
@@ -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());
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user