Implicit usings and more global usings

This commit is contained in:
Kwoth
2021-12-21 02:19:21 +01:00
parent 9223d78849
commit c66e491ce9
317 changed files with 272 additions and 1425 deletions

View File

@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace NadekoBot.Common;

View File

@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using Discord.Commands;
namespace NadekoBot.Common.Attributes;

View File

@@ -1,6 +1,4 @@
using Discord.Commands;
namespace Discord;
namespace Discord;
public class BotPermAttribute : RequireBotPermissionAttribute
{

View File

@@ -1,6 +1,4 @@
using System.IO;
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
public static class CommandNameLoadHelper
{

View File

@@ -1,6 +1,4 @@
using Discord.Commands;
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Method)]
public sealed class DescriptionAttribute : SummaryAttribute

View File

@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using Discord.Commands;
namespace NadekoBot.Common.Attributes;

View File

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

View File

@@ -1,8 +1,5 @@
using System.Threading.Tasks;
using Discord.Commands;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using NadekoBot.Extensions;
using NadekoBot.Services;
namespace NadekoBot.Common.Attributes;

View File

@@ -1,7 +1,4 @@
using Discord.Commands;
using NadekoBot.Services;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace NadekoBot.Common.Attributes;

View File

@@ -1,6 +1,4 @@
using Discord.Commands;
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Method)]
public sealed class UsageAttribute : RemarksAttribute

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using NadekoBot.Modules.Administration.Services;
namespace Discord;

View File

@@ -3,7 +3,6 @@
using System.Collections;
using System.Diagnostics;
using System.Threading;
namespace NadekoBot.Common.Collections;

View File

@@ -1,10 +1,4 @@
using NadekoBot.Services;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using Discord;
namespace NadekoBot.Common;
namespace NadekoBot.Common;
public class DownloadTracker : INService
{

View File

@@ -1,6 +1,4 @@
using Discord;
namespace NadekoBot.Extensions;
namespace NadekoBot.Extensions;
public static class BotCredentialsExtensions
{

View File

@@ -1,8 +1,6 @@
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using NadekoBot.Common;
using NadekoBot.Modules.Music;
using NadekoBot.Services;
using NadekoBot.Modules.Music.Resolvers;
using NadekoBot.Modules.Music.Services;
using StackExchange.Redis;

View File

@@ -1,6 +1,4 @@
using NadekoBot.Common;
namespace NadekoBot;
namespace NadekoBot;
public interface IBotCredentials
{

View File

@@ -1,6 +1,4 @@
using Discord;
namespace NadekoBot;
namespace NadekoBot;
public interface IEmbedBuilder
{

View File

@@ -1,6 +1,5 @@
using System.Net;
using System.Runtime.CompilerServices;
using Discord.Net;
namespace NadekoBot.Common;

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
namespace NadekoBot.Common.ModuleBehaviors;
namespace NadekoBot.Common.ModuleBehaviors;
/// <summary>
/// All services which need to execute something after

View File

@@ -1,10 +1,5 @@
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using NadekoBot.Services;
using NadekoBot.Extensions;
using NadekoBot.Extensions;
using System.Globalization;
using System.Threading.Tasks;
namespace NadekoBot.Modules;

View File

@@ -1,7 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
namespace NadekoBot.Common;
namespace NadekoBot.Common;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public sealed class NoPublicBotAttribute : PreconditionAttribute

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
namespace NadekoBot.Common;
namespace NadekoBot.Common;
public class EventPubSub : IPubSub
{

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
namespace NadekoBot.Common;
namespace NadekoBot.Common;
public interface IPubSub
{

View File

@@ -1,5 +1,4 @@
using System.Threading.Tasks;
using NadekoBot.Extensions;
using NadekoBot.Extensions;
using StackExchange.Redis;
namespace NadekoBot.Common;

View File

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

View File

@@ -1,6 +1,6 @@
using System.Text.RegularExpressions;
namespace NadekoBot.Common.Replacements;
namespace NadekoBot.Common;
public class Replacer
{

View File

@@ -1,5 +1,4 @@
using Discord;
using NadekoBot.Extensions;
using NadekoBot.Extensions;
namespace NadekoBot;

View File

@@ -1,8 +1,4 @@
using Discord;
using Discord.WebSocket;
using System.Threading.Tasks;
namespace NadekoBot.Common;
namespace NadekoBot.Common;
public sealed class ReactionEventWrapper : IDisposable
{

View File

@@ -1,7 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Services;
using NadekoBot.Modules.CustomReactions.Services;
using NadekoBot.Modules.CustomReactions.Services;
namespace NadekoBot.Common.TypeReaders;

View File

@@ -1,8 +1,4 @@
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
namespace NadekoBot.Common.TypeReaders;
namespace NadekoBot.Common.TypeReaders;
public sealed class EmoteTypeReader : NadekoTypeReader<Emote>
{

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Modules.Administration.Services;
using NadekoBot.Modules.Administration.Services;
namespace NadekoBot.Common.TypeReaders;

View File

@@ -1,9 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using Discord.WebSocket;
using Discord;
namespace NadekoBot.Common.TypeReaders;
namespace NadekoBot.Common.TypeReaders;
public sealed class GuildTypeReader : NadekoTypeReader<IGuild>
{

View File

@@ -1,7 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
namespace NadekoBot.Common.TypeReaders;
namespace NadekoBot.Common.TypeReaders;
public sealed class KwumTypeReader : NadekoTypeReader<kwum>
{

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Extensions;
using NadekoBot.Extensions;
namespace NadekoBot.Common.TypeReaders;

View File

@@ -1,7 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
namespace NadekoBot.Common.TypeReaders;
namespace NadekoBot.Common.TypeReaders;
public abstract class NadekoTypeReader<T> : TypeReader
{

View File

@@ -1,6 +1,4 @@
using System.Threading.Tasks;
using Discord.Commands;
using NadekoBot.Common.TypeReaders.Models;
using NadekoBot.Common.TypeReaders.Models;
namespace NadekoBot.Common.TypeReaders;

View File

@@ -1,8 +1,5 @@
using System.Threading.Tasks;
using Discord.Commands;
using SixLabors.ImageSharp;
namespace NadekoBot.Common.TypeReaders;
namespace NadekoBot.Common.TypeReaders;
using Color = SixLabors.ImageSharp.Color;
public sealed class Rgba32TypeReader : NadekoTypeReader<Color>
{

View File

@@ -1,9 +1,6 @@
using Discord.Commands;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using NadekoBot.Db;
using NadekoBot.Modules.Gambling.Services;
using NadekoBot.Services;
namespace NadekoBot.Common.TypeReaders;

View File

@@ -1,6 +1,4 @@
using Discord.Commands;
using NadekoBot.Common.TypeReaders.Models;
using System.Threading.Tasks;
using NadekoBot.Common.TypeReaders.Models;
namespace NadekoBot.Common.TypeReaders;