Reorganizing module and submodule folders

This commit is contained in:
Kwoth
2022-01-01 16:25:00 +01:00
parent 9b4eb21321
commit 9c590668df
69 changed files with 17 additions and 41 deletions

View File

@@ -8,7 +8,7 @@ public partial class Administration
[Group]
public partial class LocalizationCommands : NadekoSubmodule
{
private static readonly IReadOnlyDictionary<string, string> supportedLocales = new Dictionary<string, string>
private static readonly IReadOnlyDictionary<string, string> _supportedLocales = new Dictionary<string, string>
{
{ "ar", "العربية" },
{ "zh-TW", "繁體中文, 台灣" },
@@ -113,7 +113,7 @@ public partial class Administration
.WithOkColor()
.WithTitle(GetText(strs.lang_list))
.WithDescription(string.Join("\n",
supportedLocales.Select(
_supportedLocales.Select(
x => $"{Format.Code(x.Key),-10} => {x.Value}"))));
}
}

View File

@@ -1,6 +1,5 @@
#nullable disable
using NadekoBot.Common.TypeReaders.Models;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Services.Database.Models;

View File

@@ -1,7 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Services.Database.Models;
using System.Threading.Channels;
@@ -25,7 +24,7 @@ public class ProtectionService : INService
private readonly DbService _db;
private readonly UserPunishService _punishService;
private readonly Channel<PunishQueueItem> PunishUserQueue =
private readonly Channel<PunishQueueItem> _punishUserQueue =
Channel.CreateUnbounded<PunishQueueItem>(new() { SingleReader = true, SingleWriter = false });
public ProtectionService(
@@ -68,7 +67,7 @@ public class ProtectionService : INService
{
while (true)
{
var item = await PunishUserQueue.Reader.ReadAsync();
var item = await _punishUserQueue.Reader.ReadAsync();
var muteTime = item.MuteTime;
var gu = item.User;
@@ -253,7 +252,7 @@ public class ProtectionService : INService
gus[0].Guild.Name);
foreach (var gu in gus)
await PunishUserQueue.Writer.WriteAsync(new()
await _punishUserQueue.Writer.WriteAsync(new()
{
Action = action,
Type = pt,

View File

@@ -1,7 +1,7 @@
#nullable disable
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Modules.Administration.Common;
namespace NadekoBot.Modules.Administration;
public enum ProtectionType
{

View File

@@ -1,7 +1,7 @@
#nullable disable
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Modules.Administration.Common;
namespace NadekoBot.Modules.Administration;
public class PunishQueueItem
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace NadekoBot.Modules.Administration.Common;
namespace NadekoBot.Modules.Administration;
public sealed class UserSpamStats : IDisposable
{
@@ -8,9 +8,9 @@ public sealed class UserSpamStats : IDisposable
public string LastMessage { get; set; }
private ConcurrentQueue<Timer> timers { get; }
private ConcurrentQueue<Timer> timers;
private readonly object applyLock = new();
private readonly object _applyLock = new();
public UserSpamStats(IUserMessage msg)
{
@@ -22,7 +22,7 @@ public sealed class UserSpamStats : IDisposable
public void ApplyNextMessage(IUserMessage message)
{
lock (applyLock)
lock (_applyLock)
{
var upperMsg = message.Content.ToUpperInvariant();
if (upperMsg != LastMessage || (string.IsNullOrWhiteSpace(upperMsg) && message.Attachments.Any()))

View File

@@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using NadekoBot.Db;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Services.Database.Models;