Small cleanup - fixed some namespaces and moved files

This commit is contained in:
Kwoth
2021-06-27 17:11:23 +02:00
parent 670b0aca96
commit 1e90d7f7bb
14 changed files with 26 additions and 20 deletions

View File

@@ -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
{

View File

@@ -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
{

View 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);
}
}

View File

@@ -0,0 +1,38 @@
using System.Collections.Generic;
using Discord;
using System.Collections.Immutable;
using System.Linq;
using NadekoBot.Common;
namespace NadekoBot
{
public interface IBotCredentials
{
string Token { get; }
string GoogleApiKey { get; }
ICollection<ulong> OwnerIds { get; }
string RapidApiKey { get; }
string PatreonAccessToken { get; }
Creds.DbOptions Db { get; }
string OsuApiKey { get; }
int TotalShards { get; }
string PatreonCampaignId { get; }
string CleverbotApiKey { get; }
RestartConfig RestartCommand { get; }
string VotesUrl { get; }
string VotesToken { get; }
string BotListToken { get; }
string RedisOptions { get; }
string LocationIqApiKey { get; }
string TimezoneDbApiKey { get; }
string CoinmarketcapApiKey { get; }
string CoordinatorUrl { get; set; }
}
public class RestartConfig
{
public string Cmd { get; set; }
public string Args { get; set; }
}
}