mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	Small cleanup - fixed some namespaces and moved files
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "profiles": {
 | 
					  "profiles": {
 | 
				
			||||||
    "Nadeko.Coordinator": {
 | 
					    "NadekoBot.Coordinator": {
 | 
				
			||||||
      "commandName": "Project",
 | 
					      "commandName": "Project",
 | 
				
			||||||
      "dotnetRunMessages": "true",
 | 
					      "dotnetRunMessages": "true",
 | 
				
			||||||
      "launchBrowser": false,
 | 
					      "launchBrowser": false,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@ using NadekoBot.Services;
 | 
				
			|||||||
using NadekoBot.Modules;
 | 
					using NadekoBot.Modules;
 | 
				
			||||||
using YamlDotNet.Serialization;
 | 
					using YamlDotNet.Serialization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class CommandStringsTests
 | 
					    public class CommandStringsTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
 | 
				
			|||||||
using NadekoBot.Services;
 | 
					using NadekoBot.Services;
 | 
				
			||||||
using NUnit.Framework;
 | 
					using NUnit.Framework;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class GroupGreetTests
 | 
					    public class GroupGreetTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class IndexedCollectionTests
 | 
					    public class IndexedCollectionTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
using NadekoBot.Common;
 | 
					using NadekoBot.Common;
 | 
				
			||||||
using NUnit.Framework;
 | 
					using NUnit.Framework;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class KwumTests
 | 
					    public class KwumTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ using NadekoBot.Common;
 | 
				
			|||||||
using NUnit.Framework;
 | 
					using NUnit.Framework;
 | 
				
			||||||
using NUnit.Framework.Internal;
 | 
					using NUnit.Framework.Internal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class PubSubTests
 | 
					    public class PubSubTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ using System.Text;
 | 
				
			|||||||
using NadekoBot.Common.Yml;
 | 
					using NadekoBot.Common.Yml;
 | 
				
			||||||
using NUnit.Framework;
 | 
					using NUnit.Framework;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Tests
 | 
					namespace NadekoBot.Tests
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public class RandomTests
 | 
					    public class RandomTests
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,8 @@ using Serilog;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot
 | 
					namespace NadekoBot
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    // todo remove all migration code from 
 | 
				
			||||||
 | 
					    // todo read prev commit
 | 
				
			||||||
    public class Bot
 | 
					    public class Bot
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private readonly IBotCredentials _creds;
 | 
					        private readonly IBotCredentials _creds;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
using Discord.Commands;
 | 
					using Discord.Commands;
 | 
				
			||||||
using NadekoBot.Services;
 | 
					 | 
				
			||||||
using Microsoft.Extensions.DependencyInjection;
 | 
					using Microsoft.Extensions.DependencyInjection;
 | 
				
			||||||
 | 
					using NadekoBot.Extensions;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot.Common.Attributes
 | 
					namespace NadekoBot.Common.Attributes
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ using NadekoBot.Common.Yml;
 | 
				
			|||||||
using NadekoBot.Services;
 | 
					using NadekoBot.Services;
 | 
				
			||||||
using YamlDotNet.Serialization;
 | 
					using YamlDotNet.Serialization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Nadeko.Common
 | 
					namespace NadekoBot.Common
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public sealed class Creds : IBotCredentials
 | 
					    public sealed class Creds : IBotCredentials
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								src/NadekoBot/Common/Extensions/IBotCredentialsExtensions.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/NadekoBot/Common/Extensions/IBotCredentialsExtensions.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					using Discord;
 | 
				
			||||||
 | 
					using NadekoBot.Common;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace NadekoBot.Extensions
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public static class BotCredentialsExtensions
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static bool IsOwner(this IBotCredentials creds, IUser user)
 | 
				
			||||||
 | 
					            => creds.OwnerIds.Contains(user.Id);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -2,9 +2,9 @@
 | 
				
			|||||||
using Discord;
 | 
					using Discord;
 | 
				
			||||||
using System.Collections.Immutable;
 | 
					using System.Collections.Immutable;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using Nadeko.Common;
 | 
					using NadekoBot.Common;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot.Services
 | 
					namespace NadekoBot
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public interface IBotCredentials
 | 
					    public interface IBotCredentials
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -30,13 +30,6 @@ namespace NadekoBot.Services
 | 
				
			|||||||
        string CoordinatorUrl { get; set; }
 | 
					        string CoordinatorUrl { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // todo move somewhere else
 | 
					 | 
				
			||||||
    public static class IBotCredentialsExtensions
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        public static bool IsOwner(this IBotCredentials creds, IUser user)
 | 
					 | 
				
			||||||
            => creds.OwnerIds.Contains(user.Id);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public class RestartConfig
 | 
					    public class RestartConfig
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public string Cmd { get; set; }
 | 
					        public string Cmd { get; set; }
 | 
				
			||||||
@@ -6,7 +6,7 @@ using NadekoBot.Services;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.IO;
 | 
					using System.IO;
 | 
				
			||||||
using Microsoft.Extensions.Logging;
 | 
					using Microsoft.Extensions.Logging;
 | 
				
			||||||
using Nadeko.Common;
 | 
					using NadekoBot.Common;
 | 
				
			||||||
using NadekoBot.Db.Models;
 | 
					using NadekoBot.Db.Models;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot.Services.Database
 | 
					namespace NadekoBot.Services.Database
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
using Microsoft.Extensions.Configuration;
 | 
					using Microsoft.Extensions.Configuration;
 | 
				
			||||||
using System.IO;
 | 
					using System.IO;
 | 
				
			||||||
using Microsoft.Extensions.Primitives;
 | 
					using Microsoft.Extensions.Primitives;
 | 
				
			||||||
using Nadeko.Common;
 | 
					using NadekoBot.Common;
 | 
				
			||||||
using NadekoBot.Common;
 | 
					using NadekoBot.Common;
 | 
				
			||||||
using NadekoBot.Common.Yml;
 | 
					using NadekoBot.Common.Yml;
 | 
				
			||||||
using Serilog;
 | 
					using Serilog;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user