mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Small cleanup - fixed some namespaces and moved files
This commit is contained in:
@@ -28,6 +28,8 @@ using Serilog;
|
||||
|
||||
namespace NadekoBot
|
||||
{
|
||||
// todo remove all migration code from
|
||||
// todo read prev commit
|
||||
public class Bot
|
||||
{
|
||||
private readonly IBotCredentials _creds;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
using NadekoBot.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NadekoBot.Extensions;
|
||||
|
||||
namespace NadekoBot.Common.Attributes
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@ using NadekoBot.Common.Yml;
|
||||
using NadekoBot.Services;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Nadeko.Common
|
||||
namespace NadekoBot.Common
|
||||
{
|
||||
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 System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Nadeko.Common;
|
||||
using NadekoBot.Common;
|
||||
|
||||
namespace NadekoBot.Services
|
||||
namespace NadekoBot
|
||||
{
|
||||
public interface IBotCredentials
|
||||
{
|
||||
@@ -30,13 +30,6 @@ namespace NadekoBot.Services
|
||||
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 string Cmd { get; set; }
|
@@ -6,7 +6,7 @@ using NadekoBot.Services;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Nadeko.Common;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Db.Models;
|
||||
|
||||
namespace NadekoBot.Services.Database
|
||||
|
@@ -2,7 +2,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Nadeko.Common;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Common.Yml;
|
||||
using Serilog;
|
||||
|
Reference in New Issue
Block a user