Huge refactor is over

This commit is contained in:
Master Kwoth 2017-07-17 21:42:36 +02:00
parent 618968d2e4
commit c054543d98
201 changed files with 929 additions and 863 deletions

View File

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace NadekoBot.DataStructures namespace NadekoBot.Common
{ {
public class AsyncLazy<T> : Lazy<Task<T>> public class AsyncLazy<T> : Lazy<Task<T>>
{ {

View File

@ -1,9 +1,10 @@
using Discord.Commands; using System.Linq;
using NadekoBot.Services;
using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Discord.Commands;
using NadekoBot.Services;
using NadekoBot.Services.Impl;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
public class Aliases : AliasAttribute public class Aliases : AliasAttribute
{ {

View File

@ -1,8 +1,9 @@
using Discord.Commands; using System.Runtime.CompilerServices;
using Discord.Commands;
using NadekoBot.Services; using NadekoBot.Services;
using System.Runtime.CompilerServices; using NadekoBot.Services.Impl;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
public class Description : SummaryAttribute public class Description : SummaryAttribute
{ {

View File

@ -1,8 +1,9 @@
using Discord.Commands; using System.Runtime.CompilerServices;
using Discord.Commands;
using NadekoBot.Services; using NadekoBot.Services;
using System.Runtime.CompilerServices; using NadekoBot.Services.Impl;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
public class NadekoCommand : CommandAttribute public class NadekoCommand : CommandAttribute
{ {

View File

@ -1,7 +1,7 @@
using Discord.Commands; using System;
using System; using Discord.Commands;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
sealed class NadekoModuleAttribute : GroupAttribute sealed class NadekoModuleAttribute : GroupAttribute

View File

@ -1,9 +1,9 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using System;
using NadekoBot.Services; using NadekoBot.Services;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
public class OwnerOnlyAttribute : PreconditionAttribute public class OwnerOnlyAttribute : PreconditionAttribute
{ {

View File

@ -1,8 +1,9 @@
using Discord.Commands; using System.Runtime.CompilerServices;
using Discord.Commands;
using NadekoBot.Services; using NadekoBot.Services;
using System.Runtime.CompilerServices; using NadekoBot.Services.Impl;
namespace NadekoBot.Attributes namespace NadekoBot.Common.Attributes
{ {
public class Usage : RemarksAttribute public class Usage : RemarksAttribute
{ {

View File

@ -1,10 +1,10 @@
using Discord; using System;
using Discord;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using Newtonsoft.Json; using Newtonsoft.Json;
using NLog; using NLog;
using System;
namespace NadekoBot.DataStructures namespace NadekoBot.Common
{ {
public class CREmbed public class CREmbed
{ {

View File

@ -1,13 +1,14 @@
// License MIT // License MIT
// Source: https://github.com/i3arnon/ConcurrentHashSet // Source: https://github.com/i3arnon/ConcurrentHashSet
using ConcurrentCollections; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
namespace System.Collections.Concurrent namespace NadekoBot.Common.Collections
{ {
/// <summary> /// <summary>
/// Represents a thread-safe hash-based unique collection. /// Represents a thread-safe hash-based unique collection.

View File

@ -2,9 +2,8 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace NadekoBot.DataStructures namespace NadekoBot.Common.Collections
{ {
public static class DisposableReadOnlyListExtensions public static class DisposableReadOnlyListExtensions
{ {
public static IDisposableReadOnlyList<T> AsDisposable<T>(this IReadOnlyList<T> arr) where T : IDisposable public static IDisposableReadOnlyList<T> AsDisposable<T>(this IReadOnlyList<T> arr) where T : IDisposable

View File

@ -1,11 +1,11 @@
using NadekoBot.Services.Database.Models; using System.Collections;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.DataStructures namespace NadekoBot.Common.Collections
{ {
public class IndexedCollection<T> : IList<T> where T : IIndexed public class IndexedCollection<T> : IList<T> where T : class, IIndexed
{ {
public List<T> Source { get; } public List<T> Source { get; }
private readonly object _locker = new object(); private readonly object _locker = new object();

View File

@ -1,29 +1,19 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures namespace NadekoBot.Common.Collections
{ {
public class PoopyRingBuffer : IDisposable public class PoopyRingBuffer : IDisposable
{ {
// readpos == writepos means empty // readpos == writepos means empty
// writepos == readpos - 1 means full // writepos == readpos - 1 means full
private byte[] buffer; private byte[] _buffer;
public int Capacity { get; } public int Capacity { get; }
private int _readPos = 0; private int ReadPos { get; set; } = 0;
private int ReadPos private int WritePos { get; set; } = 0;
{
get => _readPos;
set => _readPos = value;
}
private int _writePos = 0;
private int WritePos
{
get => _writePos;
set => _writePos = value;
}
public int Length => ReadPos <= WritePos public int Length => ReadPos <= WritePos
? WritePos - ReadPos ? WritePos - ReadPos
: Capacity - (ReadPos - WritePos); : Capacity - (ReadPos - WritePos);
@ -38,7 +28,7 @@ namespace NadekoBot.DataStructures
public PoopyRingBuffer(int capacity = 81920 * 100) public PoopyRingBuffer(int capacity = 81920 * 100)
{ {
this.Capacity = capacity + 1; this.Capacity = capacity + 1;
this.buffer = new byte[this.Capacity]; this._buffer = new byte[this.Capacity];
} }
public int Read(byte[] b, int offset, int toRead) public int Read(byte[] b, int offset, int toRead)
@ -51,7 +41,7 @@ namespace NadekoBot.DataStructures
if (WritePos > ReadPos) if (WritePos > ReadPos)
{ {
Array.Copy(buffer, ReadPos, b, offset, toRead); Array.Copy(_buffer, ReadPos, b, offset, toRead);
ReadPos += toRead; ReadPos += toRead;
} }
else else
@ -60,12 +50,12 @@ namespace NadekoBot.DataStructures
var firstRead = toRead > toEnd ? var firstRead = toRead > toEnd ?
toEnd : toEnd :
toRead; toRead;
Array.Copy(buffer, ReadPos, b, offset, firstRead); Array.Copy(_buffer, ReadPos, b, offset, firstRead);
ReadPos += firstRead; ReadPos += firstRead;
var secondRead = toRead - firstRead; var secondRead = toRead - firstRead;
if (secondRead > 0) if (secondRead > 0)
{ {
Array.Copy(buffer, 0, b, offset + firstRead, secondRead); Array.Copy(_buffer, 0, b, offset + firstRead, secondRead);
ReadPos = secondRead; ReadPos = secondRead;
} }
} }
@ -82,7 +72,7 @@ namespace NadekoBot.DataStructures
if (WritePos < ReadPos) if (WritePos < ReadPos)
{ {
Array.Copy(b, offset, buffer, WritePos, toWrite); Array.Copy(b, offset, _buffer, WritePos, toWrite);
WritePos += toWrite; WritePos += toWrite;
} }
else else
@ -91,11 +81,11 @@ namespace NadekoBot.DataStructures
var firstWrite = toWrite > toEnd ? var firstWrite = toWrite > toEnd ?
toEnd : toEnd :
toWrite; toWrite;
Array.Copy(b, offset, buffer, WritePos, firstWrite); Array.Copy(b, offset, _buffer, WritePos, firstWrite);
var secondWrite = toWrite - firstWrite; var secondWrite = toWrite - firstWrite;
if (secondWrite > 0) if (secondWrite > 0)
{ {
Array.Copy(b, offset + firstWrite, buffer, 0, secondWrite); Array.Copy(b, offset + firstWrite, _buffer, 0, secondWrite);
WritePos = secondWrite; WritePos = secondWrite;
} }
else else
@ -110,7 +100,7 @@ namespace NadekoBot.DataStructures
public void Dispose() public void Dispose()
{ {
buffer = null; _buffer = null;
} }
} }
} }

View File

@ -1,7 +1,7 @@
using Discord; using System.Threading.Tasks;
using System.Threading.Tasks; using Discord;
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
/// <summary> /// <summary>
/// Implemented by modules which block execution before anything is executed /// Implemented by modules which block execution before anything is executed

View File

@ -1,8 +1,8 @@
using Discord; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
/// <summary> /// <summary>
/// Implemented by modules which can execute something and prevent further commands from being executed. /// Implemented by modules which can execute something and prevent further commands from being executed.

View File

@ -1,4 +1,4 @@
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
public interface IEarlyExecutor public interface IEarlyExecutor
{ {

View File

@ -1,7 +1,7 @@
using Discord; using System.Threading.Tasks;
using System.Threading.Tasks; using Discord;
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
public interface IInputTransformer public interface IInputTransformer
{ {

View File

@ -1,8 +1,8 @@
using Discord; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
public interface ILateBlocker public interface ILateBlocker
{ {

View File

@ -1,4 +1,4 @@
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
public interface ILateBlockingExecutor public interface ILateBlockingExecutor
{ {

View File

@ -1,8 +1,8 @@
using Discord; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures.ModuleBehaviors namespace NadekoBot.Common.ModuleBehaviors
{ {
/// <summary> /// <summary>
/// Last thing to be executed, won't stop further executions /// Last thing to be executed, won't stop further executions

View File

@ -1,26 +1,21 @@
using System; using System;
using System.Security.Cryptography; using System.Security.Cryptography;
namespace NadekoBot.Services namespace NadekoBot.Common
{ {
public class NadekoRandom : Random public class NadekoRandom : Random
{ {
RandomNumberGenerator rng; readonly RandomNumberGenerator _rng;
public NadekoRandom() : base() public NadekoRandom() : base()
{ {
rng = RandomNumberGenerator.Create(); _rng = RandomNumberGenerator.Create();
}
private NadekoRandom(int Seed) : base(Seed)
{
rng = RandomNumberGenerator.Create();
} }
public override int Next() public override int Next()
{ {
var bytes = new byte[sizeof(int)]; var bytes = new byte[sizeof(int)];
rng.GetBytes(bytes); _rng.GetBytes(bytes);
return Math.Abs(BitConverter.ToInt32(bytes, 0)); return Math.Abs(BitConverter.ToInt32(bytes, 0));
} }
@ -29,7 +24,7 @@ namespace NadekoBot.Services
if (maxValue <= 0) if (maxValue <= 0)
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
var bytes = new byte[sizeof(int)]; var bytes = new byte[sizeof(int)];
rng.GetBytes(bytes); _rng.GetBytes(bytes);
return Math.Abs(BitConverter.ToInt32(bytes, 0)) % maxValue; return Math.Abs(BitConverter.ToInt32(bytes, 0)) % maxValue;
} }
@ -40,27 +35,27 @@ namespace NadekoBot.Services
if (minValue == maxValue) if (minValue == maxValue)
return minValue; return minValue;
var bytes = new byte[sizeof(int)]; var bytes = new byte[sizeof(int)];
rng.GetBytes(bytes); _rng.GetBytes(bytes);
var sign = Math.Sign(BitConverter.ToInt32(bytes, 0)); var sign = Math.Sign(BitConverter.ToInt32(bytes, 0));
return (sign * BitConverter.ToInt32(bytes, 0)) % (maxValue - minValue) + minValue; return (sign * BitConverter.ToInt32(bytes, 0)) % (maxValue - minValue) + minValue;
} }
public override void NextBytes(byte[] buffer) public override void NextBytes(byte[] buffer)
{ {
rng.GetBytes(buffer); _rng.GetBytes(buffer);
} }
protected override double Sample() protected override double Sample()
{ {
var bytes = new byte[sizeof(double)]; var bytes = new byte[sizeof(double)];
rng.GetBytes(bytes); _rng.GetBytes(bytes);
return Math.Abs(BitConverter.ToDouble(bytes, 0) / double.MaxValue + 1); return Math.Abs(BitConverter.ToDouble(bytes, 0) / double.MaxValue + 1);
} }
public override double NextDouble() public override double NextDouble()
{ {
var bytes = new byte[sizeof(double)]; var bytes = new byte[sizeof(double)];
rng.GetBytes(bytes); _rng.GetBytes(bytes);
return BitConverter.ToDouble(bytes, 0); return BitConverter.ToDouble(bytes, 0);
} }
} }

View File

@ -1,8 +1,8 @@
using Discord.Commands; using System;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
namespace NadekoBot.DataStructures namespace NadekoBot.Common
{ {
public class NoPublicBot : PreconditionAttribute public class NoPublicBot : PreconditionAttribute
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace ConcurrentCollections namespace NadekoBot.Common
{ {
public static class PlatformHelper public static class PlatformHelper
{ {

View File

@ -1,16 +1,15 @@
using Discord; using System;
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Modules.Music.Services;
using NadekoBot.Services;
using NadekoBot.Services.Administration;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Modules.Music.Services;
namespace NadekoBot.DataStructures.Replacements namespace NadekoBot.Common.Replacements
{ {
public class ReplacementBuilder public class ReplacementBuilder
{ {

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace NadekoBot.DataStructures.Replacements namespace NadekoBot.Common.Replacements
{ {
public class Replacer public class Replacer
{ {

View File

@ -1,22 +1,19 @@
using Discord.Commands; using System;
using Discord.WebSocket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
using Discord.WebSocket;
namespace NadekoBot.DataStructures namespace NadekoBot.Common
{ {
public class Shard0Precondition : PreconditionAttribute public class Shard0Precondition : PreconditionAttribute
{ {
public override Task<PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider services) public override Task<PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider services)
{ {
var c = (DiscordSocketClient)context.Client; var c = (DiscordSocketClient)context.Client;
if (c.ShardId == 0) if (c.ShardId != 0)
return Task.FromResult(PreconditionResult.FromSuccess());
else
return Task.FromResult(PreconditionResult.FromError("Must be ran from shard #0")); return Task.FromResult(PreconditionResult.FromError("Must be ran from shard #0"));
return Task.FromResult(PreconditionResult.FromSuccess());
} }
} }
} }

View File

@ -1,11 +1,7 @@
using Discord; using System;
using System; using Discord;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures.ShardCom namespace NadekoBot.Common.ShardCom
{ {
public class ShardComMessage public class ShardComMessage
{ {

View File

@ -1,11 +1,10 @@
using Newtonsoft.Json; using System.Net;
using System;
using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json;
namespace NadekoBot.DataStructures.ShardCom namespace NadekoBot.Common.ShardCom
{ {
public class ShardComClient public class ShardComClient
{ {

View File

@ -1,11 +1,11 @@
using Newtonsoft.Json; using System;
using System;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json;
namespace NadekoBot.DataStructures.ShardCom namespace NadekoBot.Common.ShardCom
{ {
public class ShardComServer : IDisposable public class ShardComServer : IDisposable
{ {

View File

@ -1,23 +0,0 @@
using Discord.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NadekoBot.DataStructures
{
//public class SyncPrecondition : PreconditionAttribute
//{
// public override Task<PreconditionResult> CheckPermissions(ICommandContext context,
// CommandInfo command,
// IServiceProvider services)
// {
// }
//}
//public enum SyncType
//{
// Guild
//}
}

View File

@ -1,11 +1,11 @@
using Discord.Commands; using System;
using NadekoBot.Modules.CustomReactions.Services;
using NadekoBot.Services;
using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Modules.CustomReactions.Services;
using NadekoBot.Services;
namespace NadekoBot.TypeReaders namespace NadekoBot.Common.TypeReaders
{ {
public class CommandTypeReader : TypeReader public class CommandTypeReader : TypeReader
{ {

View File

@ -1,10 +1,9 @@
using Discord.Commands; using System;
using NadekoBot.Services;
using NadekoBot.Services.Administration;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.TypeReaders namespace NadekoBot.Common.TypeReaders
{ {
public class GuildDateTimeTypeReader : TypeReader public class GuildDateTimeTypeReader : TypeReader
{ {

View File

@ -1,10 +1,10 @@
using Discord.Commands; using System;
using Discord.WebSocket;
using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
using Discord.WebSocket;
namespace NadekoBot.TypeReaders namespace NadekoBot.Common.TypeReaders
{ {
public class GuildTypeReader : TypeReader public class GuildTypeReader : TypeReader
{ {

View File

@ -1,4 +1,4 @@
namespace NadekoBot.Modules.Permissions namespace NadekoBot.Common.TypeReaders.Models
{ {
public class PermissionAction public class PermissionAction
{ {

View File

@ -1,10 +1,10 @@
using Discord.Commands; using System;
using NadekoBot.Extensions;
using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Extensions;
namespace NadekoBot.TypeReaders namespace NadekoBot.Common.TypeReaders
{ {
public class ModuleTypeReader : TypeReader public class ModuleTypeReader : TypeReader
{ {

View File

@ -1,9 +1,9 @@
using Discord.Commands; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Modules.Permissions; using Discord.Commands;
using System; using NadekoBot.Common.TypeReaders.Models;
namespace NadekoBot.TypeReaders namespace NadekoBot.Common.TypeReaders
{ {
/// <summary> /// <summary>
/// Used instead of bool for more flexible keywords for true/false only in the permission module /// Used instead of bool for more flexible keywords for true/false only in the permission module

View File

@ -5,10 +5,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Attributes; using NadekoBot.Modules.Administration.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Administration;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,11 +1,11 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace NadekoBot.Modules.Administration.Commands.Migration namespace NadekoBot.Modules.Administration.Common.Migration
{ {
public class CommandPrefixes0_9 public class CommandPrefixes0_9
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace NadekoBot.Modules.Administration.Commands.Migration namespace NadekoBot.Modules.Administration.Common.Migration
{ {
public class MigrationException : Exception public class MigrationException : Exception
{ {

View File

@ -1,8 +1,9 @@
using Discord; using System.Collections.Concurrent;
using Discord;
using NadekoBot.Common.Collections;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Collections.Concurrent;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Common
{ {
public enum ProtectionType public enum ProtectionType
{ {

View File

@ -1,12 +1,13 @@
using Discord.WebSocket; using System;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.WebSocket;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Common
{ {
public class Ratelimiter public class Ratelimiter
{ {

View File

@ -1,10 +1,10 @@
using Discord; using System;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Discord;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Common
{ {
public class UserSpamStats : IDisposable public class UserSpamStats : IDisposable
{ {

View File

@ -1,9 +1,9 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Services.Administration; using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -8,6 +7,7 @@ using System.Collections.Immutable;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,16 +1,17 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.DataStructures;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Modules.Permissions; using NadekoBot.Modules.Permissions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using static NadekoBot.Services.Administration.LogCommandService; using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.TypeReaders.Models;
using NadekoBot.Modules.Administration.Services;
using static NadekoBot.Modules.Administration.Services.LogCommandService;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -4,27 +4,28 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using Newtonsoft.Json; using Newtonsoft.Json;
using NadekoBot.Modules.Administration.Commands.Migration;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services.Database; using NadekoBot.Services.Database;
using Microsoft.Data.Sqlite; using Microsoft.Data.Sqlite;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
using NadekoBot.Modules.Administration.Common.Migration;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {
public partial class Administration public partial class Administration
{ {
[Group] [Group]
public class Migration : NadekoSubmodule public class MigrationCommands : NadekoSubmodule
{ {
private const int CURRENT_VERSION = 1; private const int CURRENT_VERSION = 1;
private readonly DbService _db; private readonly DbService _db;
public Migration(DbService db) public MigrationCommands(DbService db)
{ {
_db = db; _db = db;
} }

View File

@ -1,10 +1,10 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,10 +1,10 @@
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,7 +1,7 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,14 +1,15 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Services.Administration; using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,10 +1,10 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services.Administration;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,14 +1,15 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,7 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -11,6 +10,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -12,8 +11,9 @@ using Discord.WebSocket;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Administration;
using System.Diagnostics; using System.Diagnostics;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Modules.Music.Services; using NadekoBot.Modules.Music.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration

View File

@ -1,10 +1,10 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,15 +1,17 @@
using Discord; using System;
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Common.Collections;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class AdministrationService : INService public class AdministrationService : INService
{ {

View File

@ -1,13 +1,14 @@
using Discord.WebSocket; using System;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.WebSocket;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class AutoAssignRoleService : INService public class AutoAssignRoleService : INService
{ {

View File

@ -1,14 +1,16 @@
using Discord.WebSocket; using System;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.WebSocket;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class GameVoiceChannelService : INService public class GameVoiceChannelService : INService
{ {

View File

@ -1,13 +1,13 @@
using NadekoBot.Extensions; using System;
using NadekoBot.Services.Database.Models; using System.Collections.Concurrent;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Collections.Concurrent;
using NadekoBot.Services;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class GuildTimezoneService : INService public class GuildTimezoneService : INService
{ {

View File

@ -1,17 +1,19 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Impl;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class LogCommandService : INService public class LogCommandService : INService
{ {

View File

@ -1,17 +1,19 @@
using Discord; using System;
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public enum MuteType public enum MuteType
{ {

View File

@ -1,13 +1,14 @@
using Discord.WebSocket; using System;
using NadekoBot.DataStructures.Replacements;
using NadekoBot.Modules.Music.Services;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Discord.WebSocket;
using NadekoBot.Common.Replacements;
using NadekoBot.Modules.Music.Services;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class PlayingRotateService : INService public class PlayingRotateService : INService
{ {

View File

@ -1,14 +1,16 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class ProtectionService : INService public class ProtectionService : INService
{ {

View File

@ -1,13 +1,14 @@
using Discord; using System;
using NadekoBot.Extensions;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Services;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class PruneService : INService public class PruneService : INService
{ {

View File

@ -1,16 +1,18 @@
using Discord.WebSocket; using System;
using NadekoBot.DataStructures.ModuleBehaviors;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Discord;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class SlowmodeService : IEarlyBlocker, INService public class SlowmodeService : IEarlyBlocker, INService
{ {

View File

@ -1,16 +1,18 @@
using Discord; using System.Collections.Generic;
using NadekoBot.DataStructures;
using NadekoBot.DataStructures.ModuleBehaviors;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using System.Collections.Generic; using NadekoBot.Common;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Impl;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class SelfService : ILateExecutor, INService public class SelfService : ILateExecutor, INService
{ {

View File

@ -1,12 +1,13 @@
using Discord; using System;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class UserPunishService : INService public class UserPunishService : INService
{ {

View File

@ -1,14 +1,15 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class VcRoleService : INService public class VcRoleService : INService
{ {

View File

@ -1,17 +1,20 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Impl;
using NLog;
namespace NadekoBot.Services.Administration namespace NadekoBot.Modules.Administration.Services
{ {
public class VplusTService : INService public class VplusTService : INService
{ {

View File

@ -1,12 +1,12 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services.Administration;
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -2,13 +2,13 @@
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -2,14 +2,14 @@
using System.Linq; using System.Linq;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.WebSocket; using Discord.WebSocket;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Administration;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -1,14 +1,14 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Administration;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Modules.Administration namespace NadekoBot.Modules.Administration
{ {

View File

@ -2,12 +2,12 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Attributes;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using Discord; using Discord;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using Discord.WebSocket; using Discord.WebSocket;
using System; using System;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.CustomReactions.Services; using NadekoBot.Modules.CustomReactions.Services;
namespace NadekoBot.Modules.CustomReactions namespace NadekoBot.Modules.CustomReactions

View File

@ -2,8 +2,6 @@
using AngleSharp.Dom.Html; using AngleSharp.Dom.Html;
using Discord; using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.DataStructures;
using NadekoBot.DataStructures.Replacements;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Modules.CustomReactions.Services; using NadekoBot.Modules.CustomReactions.Services;
using NadekoBot.Services; using NadekoBot.Services;
@ -13,6 +11,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Replacements;
namespace NadekoBot.Modules.CustomReactions.Extensions namespace NadekoBot.Modules.CustomReactions.Extensions
{ {

View File

@ -1,17 +1,20 @@
using Discord; using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.DataStructures.ModuleBehaviors;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using NLog; using NLog;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Linq; using System.Linq;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Services.Permissions; using NadekoBot.Common;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services.Database; using NadekoBot.Services.Database;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Modules.CustomReactions.Extensions; using NadekoBot.Modules.CustomReactions.Extensions;
using NadekoBot.Modules.Permissions.Common;
using NadekoBot.Modules.Permissions.Services;
using NadekoBot.Services.Impl;
namespace NadekoBot.Modules.CustomReactions.Services namespace NadekoBot.Modules.CustomReactions.Services
{ {

View File

@ -1,7 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -12,13 +11,16 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Services.Impl;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling
{ {
public partial class Gambling public partial class Gambling
{ {
[Group] [Group]
public class AnimalRacing : NadekoSubmodule public class AnimalRacingCommands : NadekoSubmodule
{ {
private readonly BotConfig _bc; private readonly BotConfig _bc;
private readonly CurrencyService _cs; private readonly CurrencyService _cs;
@ -27,7 +29,7 @@ namespace NadekoBot.Modules.Gambling
public static ConcurrentDictionary<ulong, AnimalRace> AnimalRaces { get; } = new ConcurrentDictionary<ulong, AnimalRace>(); public static ConcurrentDictionary<ulong, AnimalRace> AnimalRaces { get; } = new ConcurrentDictionary<ulong, AnimalRace>();
public AnimalRacing(BotConfig bc, CurrencyService cs, DiscordSocketClient client) public AnimalRacingCommands(BotConfig bc, CurrencyService cs, DiscordSocketClient client)
{ {
_bc = bc; _bc = bc;
_cs = cs; _cs = cs;

View File

@ -1,10 +1,11 @@
using NadekoBot.Extensions; using System;
using NadekoBot.Services;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Services;
namespace NadekoBot.Modules.Gambling.Models namespace NadekoBot.Modules.Gambling.Common
{ {
public class Cards public class Cards
{ {

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using System; using System;
@ -9,6 +8,9 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.WebSocket; using Discord.WebSocket;
using System.Threading; using System.Threading;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
using NLog; using NLog;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -17,7 +19,7 @@ namespace NadekoBot.Modules.Gambling
public partial class Gambling public partial class Gambling
{ {
[Group] [Group]
public class CurrencyEvents : NadekoSubmodule public class CurrencyEventsCommands : NadekoSubmodule
{ {
public enum CurrencyEvent public enum CurrencyEvent
{ {
@ -38,7 +40,7 @@ namespace NadekoBot.Modules.Gambling
private readonly BotConfig _bc; private readonly BotConfig _bc;
private readonly CurrencyService _cs; private readonly CurrencyService _cs;
public CurrencyEvents(DiscordSocketClient client, BotConfig bc, CurrencyService cs) public CurrencyEventsCommands(DiscordSocketClient client, BotConfig bc, CurrencyService cs)
{ {
_client = client; _client = client;
_bc = bc; _bc = bc;

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using System; using System;
@ -9,6 +8,8 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using Image = ImageSharp.Image; using Image = ImageSharp.Image;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling

View File

@ -1,13 +1,13 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Modules.Gambling.Models;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Gambling.Common;
using Image = ImageSharp.Image; using Image = ImageSharp.Image;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling

View File

@ -1,12 +1,13 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using Image = ImageSharp.Image; using Image = ImageSharp.Image;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling

View File

@ -2,8 +2,6 @@
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NadekoBot.Attributes;
using NadekoBot.DataStructures;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -11,13 +9,16 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling
{ {
public partial class Gambling public partial class Gambling
{ {
[Group] [Group]
public class FlowerShop : NadekoSubmodule public class FlowerShopCommands : NadekoSubmodule
{ {
private readonly BotConfig _bc; private readonly BotConfig _bc;
private readonly DbService _db; private readonly DbService _db;
@ -34,7 +35,7 @@ namespace NadekoBot.Modules.Gambling
List List
} }
public FlowerShop(BotConfig bc, DbService db, CurrencyService cs, DiscordSocketClient client) public FlowerShopCommands(BotConfig bc, DbService db, CurrencyService cs, DiscordSocketClient client)
{ {
_db = db; _db = db;
_bc = bc; _bc = bc;

View File

@ -1,12 +1,13 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
using System.Collections.Generic; using System.Collections.Generic;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling
{ {

View File

@ -1,7 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using ImageSharp; using ImageSharp;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -11,13 +10,15 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling
{ {
public partial class Gambling public partial class Gambling
{ {
[Group] [Group]
public class Slots : NadekoSubmodule public class SlotCommands : NadekoSubmodule
{ {
private static int _totalBet; private static int _totalBet;
private static int _totalPaidOut; private static int _totalPaidOut;
@ -34,7 +35,7 @@ namespace NadekoBot.Modules.Gambling
private readonly IImagesService _images; private readonly IImagesService _images;
private readonly CurrencyService _cs; private readonly CurrencyService _cs;
public Slots(IImagesService images, BotConfig bc, CurrencyService cs) public SlotCommands(IImagesService images, BotConfig bc, CurrencyService cs)
{ {
_images = images; _images = images;
_bc = bc; _bc = bc;

View File

@ -1,6 +1,5 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NadekoBot.Services.Database.Models; using NadekoBot.Services.Database.Models;
@ -9,6 +8,8 @@ using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Gambling namespace NadekoBot.Modules.Gambling
{ {

View File

@ -1,7 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket; using Discord.WebSocket;
using NadekoBot.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services; using NadekoBot.Services;
using NLog; using NLog;
@ -12,20 +11,24 @@ using System.Collections.Immutable;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Common.Collections;
using NadekoBot.Services.Impl;
namespace NadekoBot.Modules.Games namespace NadekoBot.Modules.Games
{ {
public partial class Games public partial class Games
{ {
[Group] [Group]
public class Acropobia : NadekoSubmodule public class AcropobiaCommands : NadekoSubmodule
{ {
private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;
//channelId, game //channelId, game
public static ConcurrentDictionary<ulong, AcrophobiaGame> AcrophobiaGames { get; } = new ConcurrentDictionary<ulong, AcrophobiaGame>(); public static ConcurrentDictionary<ulong, AcrophobiaGame> AcrophobiaGames { get; } = new ConcurrentDictionary<ulong, AcrophobiaGame>();
public Acropobia(DiscordSocketClient client) public AcropobiaCommands(DiscordSocketClient client)
{ {
_client = client; _client = client;
} }

View File

@ -1,10 +1,11 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Services; using NadekoBot.Services;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Services.Games; using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Games.Common;
using NadekoBot.Modules.Games.Services;
namespace NadekoBot.Modules.Games namespace NadekoBot.Modules.Games
{ {

View File

@ -1,4 +1,4 @@
namespace NadekoBot.Services.Games namespace NadekoBot.Modules.Games.Common
{ {
public class ChatterBotResponse public class ChatterBotResponse
{ {

View File

@ -1,9 +1,11 @@
using NadekoBot.Extensions; using System.Net.Http;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Services;
using Newtonsoft.Json;
namespace NadekoBot.Services.Games namespace NadekoBot.Modules.Games.Common
{ {
public class ChatterBotSession public class ChatterBotSession
{ {

View File

@ -1,13 +1,14 @@
using ImageSharp; using System;
using NadekoBot.DataStructures;
using NadekoBot.Extensions;
using NLog;
using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using ImageSharp;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NLog;
namespace NadekoBot.Services.Games namespace NadekoBot.Modules.Games.Common
{ {
public class GirlRating public class GirlRating
{ {

View File

@ -1,17 +1,17 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using Newtonsoft.Json;
using NLog;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Modules.Games.Commands.Hangman; using Discord;
using Discord.WebSocket;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Services;
using Newtonsoft.Json;
using NLog;
namespace NadekoBot.Modules.Games.Hangman namespace NadekoBot.Modules.Games.Common.Hangman
{ {
public class HangmanTermPool public class HangmanTermPool
{ {

View File

@ -1,4 +1,4 @@
namespace NadekoBot.Modules.Games.Commands.Hangman namespace NadekoBot.Modules.Games.Common.Hangman
{ {
public class HangmanObject public class HangmanObject
{ {

View File

@ -1,14 +1,16 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Extensions;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Impl;
namespace NadekoBot.Services.Games namespace NadekoBot.Modules.Games.Common
{ {
//todo 75 rewrite //todo 75 rewrite
public class Poll public class Poll

View File

@ -1,19 +1,20 @@
using Discord; using System;
using Discord.Net;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NLog;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.Net;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services.Impl;
using NLog;
namespace NadekoBot.Modules.Games.Trivia namespace NadekoBot.Modules.Games.Common.Trivia
{ {
public class TriviaGame public class TriviaGame
{ {

View File

@ -1,11 +1,11 @@
using NadekoBot.Extensions; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using NadekoBot.Extensions;
// THANKS @ShoMinamimoto for suggestions and coding help // THANKS @ShoMinamimoto for suggestions and coding help
namespace NadekoBot.Modules.Games.Trivia namespace NadekoBot.Modules.Games.Common.Trivia
{ {
public class TriviaQuestion public class TriviaQuestion
{ {

View File

@ -1,13 +1,14 @@
using NadekoBot.Extensions; using System;
using NadekoBot.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Services;
using Newtonsoft.Json;
namespace NadekoBot.Modules.Games.Trivia namespace NadekoBot.Modules.Games.Common.Trivia
{ {
public class TriviaQuestionPool public class TriviaQuestionPool
{ {

View File

@ -1,4 +1,4 @@
namespace NadekoBot.Services.Games namespace NadekoBot.Modules.Games.Common
{ {
public class TypingArticle public class TypingArticle
{ {

View File

@ -1,16 +1,17 @@
using Discord; using System;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NadekoBot.Services.Games;
using NLog;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using NadekoBot.Common;
using NadekoBot.Extensions;
using NadekoBot.Modules.Games.Services;
using NadekoBot.Services;
using NLog;
namespace NadekoBot.Modules.Games.Models namespace NadekoBot.Modules.Games.Common
{ {
public class TypingGame public class TypingGame
{ {

View File

@ -2,10 +2,12 @@
using Discord; using Discord;
using NadekoBot.Services; using NadekoBot.Services;
using System.Threading.Tasks; using System.Threading.Tasks;
using NadekoBot.Attributes;
using System; using System;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using NadekoBot.Services.Games; using NadekoBot.Modules.Games.Common;
using NadekoBot.Modules.Games.Services;
namespace NadekoBot.Modules.Games namespace NadekoBot.Modules.Games
{ {

Some files were not shown because too many files have changed in this diff Show More