Removed unneeded NadekoSubmodule and NadekoSubmodule<T> classes

This commit is contained in:
Kwoth
2022-02-26 08:11:25 +01:00
parent f5a706f57a
commit 80800673b9
61 changed files with 61 additions and 68 deletions

View File

@@ -135,11 +135,3 @@ public abstract class NadekoModule<TService> : NadekoModule
{
public TService _service { get; set; }
}
public abstract class NadekoSubmodule : NadekoModule
{
}
public abstract class NadekoSubmodule<TService> : NadekoModule<TService>
{
}

View File

@@ -1,4 +1,5 @@
namespace NadekoBot.Common;
#nullable disable
namespace NadekoBot.Common;
public class OldCreds
{

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class AutoAssignRoleCommands : NadekoSubmodule<AutoAssignRoleService>
public partial class AutoAssignRoleCommands : NadekoModule<AutoAssignRoleService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Administration
{
[Group]
[OwnerOnly]
public partial class DangerousCommands : NadekoSubmodule<DangerousCommandsService>
public partial class DangerousCommands : NadekoModule<DangerousCommandsService>
{
private async Task InternalExecSql(string sql, params object[] reps)
{

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class GameVoiceChannelCommands : NadekoSubmodule<GameVoiceChannelService>
public partial class GameVoiceChannelCommands : NadekoModule<GameVoiceChannelService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -3,7 +3,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class GreetCommands : NadekoSubmodule<GreetService>
public partial class GreetCommands : NadekoModule<GreetService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class LocalizationCommands : NadekoSubmodule
public partial class LocalizationCommands : NadekoModule
{
private static readonly IReadOnlyDictionary<string, string> _supportedLocales = new Dictionary<string, string>
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class MuteCommands : NadekoSubmodule<MuteService>
public partial class MuteCommands : NadekoModule<MuteService>
{
private async Task<bool> VerifyMutePermissions(IGuildUser runnerUser, IGuildUser targetUser)
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class DiscordPermOverrideCommands : NadekoSubmodule<DiscordPermOverrideService>
public partial class DiscordPermOverrideCommands : NadekoModule<DiscordPermOverrideService>
{
// override stats, it should require that the user has managessages guild permission
// .po 'stats' add user guild managemessages

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class PlayingRotateCommands : NadekoSubmodule<PlayingRotateService>
public partial class PlayingRotateCommands : NadekoModule<PlayingRotateService>
{
[Cmd]
[OwnerOnly]

View File

@@ -4,7 +4,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class PrefixCommands : NadekoSubmodule
public partial class PrefixCommands : NadekoModule
{
public enum Set
{

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class ProtectionCommands : NadekoSubmodule<ProtectionService>
public partial class ProtectionCommands : NadekoModule<ProtectionService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class PruneCommands : NadekoSubmodule<PruneService>
public partial class PruneCommands : NadekoModule<PruneService>
{
private static readonly TimeSpan _twoWeeks = TimeSpan.FromDays(14);

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
public partial class RoleCommands : NadekoSubmodule<RoleCommandsService>
public partial class RoleCommands : NadekoModule<RoleCommandsService>
{
public enum Exclude { Excl }

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class SelfCommands : NadekoSubmodule<SelfService>
public partial class SelfCommands : NadekoModule<SelfService>
{
public enum SettableUserStatus
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class SelfAssignedRolesCommands : NadekoSubmodule<SelfAssignedRolesService>
public partial class SelfAssignedRolesCommands : NadekoModule<SelfAssignedRolesService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -7,7 +7,7 @@ public partial class Administration
{
[Group]
[NoPublicBot]
public partial class LogCommands : NadekoSubmodule<ILogCommandService>
public partial class LogCommands : NadekoModule<ILogCommandService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class TimeZoneCommands : NadekoSubmodule<GuildTimezoneService>
public partial class TimeZoneCommands : NadekoModule<GuildTimezoneService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -11,7 +11,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class UserPunishCommands : NadekoSubmodule<UserPunishService>
public partial class UserPunishCommands : NadekoModule<UserPunishService>
{
public enum AddRole
{

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Administration;
public partial class Administration
{
[Group]
public partial class VcRoleCommands : NadekoSubmodule<VcRoleService>
public partial class VcRoleCommands : NadekoModule<VcRoleService>
{
[Cmd]
[UserPerm(GuildPerm.ManageRoles)]

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Gambling;
public partial class Gambling
{
[Group]
public partial class DiceRollCommands : NadekoSubmodule
public partial class DiceRollCommands : NadekoModule
{
private static readonly Regex _dndRegex = new(@"^(?<n1>\d+)d(?<n2>\d+)(?:\+(?<add>\d+))?(?:\-(?<sub>\d+))?$",
RegexOptions.Compiled);

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Gambling;
public partial class Gambling
{
[Group]
public partial class DrawCommands : NadekoSubmodule
public partial class DrawCommands : NadekoModule
{
private static readonly ConcurrentDictionary<IGuild, Deck> _allDecks = new();
private readonly IImageCache _images;

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class AcropobiaCommands : NadekoSubmodule<GamesService>
public partial class AcropobiaCommands : NadekoModule<GamesService>
{
private readonly DiscordSocketClient _client;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class ChatterBotCommands : NadekoSubmodule<ChatterBotService>
public partial class ChatterBotCommands : NadekoModule<ChatterBotService>
{
private readonly DbService _db;

View File

@@ -5,7 +5,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class HangmanCommands : NadekoSubmodule<IHangmanService>
public partial class HangmanCommands : NadekoModule<IHangmanService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class NunchiCommands : NadekoSubmodule<GamesService>
public partial class NunchiCommands : NadekoModule<GamesService>
{
private readonly DiscordSocketClient _client;

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class PollCommands : NadekoSubmodule<PollService>
public partial class PollCommands : NadekoModule<PollService>
{
private readonly DiscordSocketClient _client;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class SpeedTypingCommands : NadekoSubmodule<GamesService>
public partial class SpeedTypingCommands : NadekoModule<GamesService>
{
private readonly GamesService _games;
private readonly DiscordSocketClient _client;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class TicTacToeCommands : NadekoSubmodule<GamesService>
public partial class TicTacToeCommands : NadekoModule<GamesService>
{
private readonly SemaphoreSlim _sem = new(1, 1);
private readonly DiscordSocketClient _client;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Games;
public partial class Games
{
[Group]
public partial class TriviaCommands : NadekoSubmodule<GamesService>
public partial class TriviaCommands : NadekoModule<GamesService>
{
private readonly IDataCache _cache;
private readonly ICurrencyService _cs;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Permissions;
public partial class Permissions
{
[Group]
public partial class BlacklistCommands : NadekoSubmodule<BlacklistService>
public partial class BlacklistCommands : NadekoModule<BlacklistService>
{
private readonly DiscordSocketClient _client;

View File

@@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Permissions;
public partial class Permissions
{
[Group]
public partial class CmdCdsCommands : NadekoSubmodule
public partial class CmdCdsCommands : NadekoModule
{
private ConcurrentDictionary<ulong, ConcurrentHashSet<CommandCooldown>> CommandCooldowns
=> _service.CommandCooldowns;

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Permissions;
public partial class Permissions
{
[Group]
public partial class FilterCommands : NadekoSubmodule<FilterService>
public partial class FilterCommands : NadekoModule<FilterService>
{
private readonly DbService _db;

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Permissions;
public partial class Permissions
{
[Group]
public partial class GlobalPermissionCommands : NadekoSubmodule
public partial class GlobalPermissionCommands : NadekoModule
{
private readonly GlobalPermissionService _service;
private readonly DbService _db;

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Permissions;
public partial class Permissions
{
[Group]
public partial class ResetPermissionsCommands : NadekoSubmodule
public partial class ResetPermissionsCommands : NadekoModule
{
private readonly GlobalPermissionService _gps;
private readonly PermissionService _perms;

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class AnimeSearchCommands : NadekoSubmodule<AnimeSearchService>
public partial class AnimeSearchCommands : NadekoModule<AnimeSearchService>
{
// [NadekoCommand, Aliases]
// public async Task Novel([Leftover] string query)

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
public partial class FinanceCommands : NadekoSubmodule<CryptoService>
public partial class FinanceCommands : NadekoModule<CryptoService>
{
private readonly IStockDataService _stocksService;
private readonly IStockChartDrawingService _stockDrawingService;

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class FeedCommands : NadekoSubmodule<FeedsService>
public partial class FeedCommands : NadekoModule<FeedsService>
{
private static readonly Regex _ytChannelRegex =
new(@"youtube\.com\/(?:c\/|channel\/|user\/)?(?<channelid>[a-zA-Z0-9\-]{1,})");

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class JokeCommands : NadekoSubmodule<SearchesService>
public partial class JokeCommands : NadekoModule<SearchesService>
{
[Cmd]
public async partial Task Yomama()

View File

@@ -8,7 +8,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class MemegenCommands : NadekoSubmodule
public partial class MemegenCommands : NadekoModule
{
private static readonly ImmutableDictionary<char, string> _map = new Dictionary<char, string>
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class OsuCommands : NadekoSubmodule
public partial class OsuCommands : NadekoModule
{
private readonly IBotCredentials _creds;
private readonly IHttpClientFactory _httpFactory;

View File

@@ -12,7 +12,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class PathOfExileCommands : NadekoSubmodule<SearchesService>
public partial class PathOfExileCommands : NadekoModule<SearchesService>
{
private const string POE_URL = "https://www.pathofexile.com/character-window/get-characters?accountName=";
private const string PON_URL = "http://poe.ninja/api/Data/GetCurrencyOverview?league=";

View File

@@ -4,7 +4,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class PlaceCommands : NadekoSubmodule
public partial class PlaceCommands : NadekoModule
{
public enum PlaceType
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class PokemonSearchCommands : NadekoSubmodule<SearchesService>
public partial class PokemonSearchCommands : NadekoModule<SearchesService>
{
public IReadOnlyDictionary<string, SearchPokemon> Pokemons
=> _cache.LocalData.Pokemons;

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class StreamNotificationCommands : NadekoSubmodule<StreamNotificationService>
public partial class StreamNotificationCommands : NadekoModule<StreamNotificationService>
{
private readonly DbService _db;

View File

@@ -4,7 +4,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class TranslateCommands : NadekoSubmodule<ITranslateService>
public partial class TranslateCommands : NadekoModule<ITranslateService>
{
public enum AutoDeleteAutoTranslate
{

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
[Group]
public partial class XkcdCommands : NadekoSubmodule
public partial class XkcdCommands : NadekoModule
{
private const string XKCD_URL = "https://xkcd.com";
private readonly IHttpClientFactory _httpFactory;

View File

@@ -4,7 +4,7 @@ namespace NadekoBot.Modules.Searches;
public partial class Searches
{
// [Group]
// public partial class YtTrackCommands : NadekoSubmodule<YtTrackService>
// public partial class YtTrackCommands : NadekoModule<YtTrackService>
// {
// ;
// [RequireContext(ContextType.Guild)]

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class CalcCommands : NadekoSubmodule
public partial class CalcCommands : NadekoModule
{
[Cmd]
public async partial Task Calculate([Leftover] string expression)

View File

@@ -9,7 +9,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class CommandMapCommands : NadekoSubmodule<CommandMapService>
public partial class CommandMapCommands : NadekoModule<CommandMapService>
{
private readonly DbService _db;
private readonly DiscordSocketClient _client;

View File

@@ -3,7 +3,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
public partial class ConfigCommands : NadekoSubmodule
public partial class ConfigCommands : NadekoModule
{
private readonly IEnumerable<IConfigService> _settingServices;

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class InfoCommands : NadekoSubmodule
public partial class InfoCommands : NadekoModule
{
private readonly DiscordSocketClient _client;
private readonly IStatsService _stats;

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class InviteCommands : NadekoSubmodule<InviteService>
public partial class InviteCommands : NadekoModule<InviteService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class QuoteCommands : NadekoSubmodule
public partial class QuoteCommands : NadekoModule
{
private const string PREPEND_EXPORT =
@"# Keys are keywords, Each key has a LIST of quotes in the following format:

View File

@@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class RemindCommands : NadekoSubmodule<RemindService>
public partial class RemindCommands : NadekoModule<RemindService>
{
public enum MeOrHere
{

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class RepeatCommands : NadekoSubmodule<RepeaterService>
public partial class RepeatCommands : NadekoModule<RepeaterService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
public partial class StreamRoleCommands : NadekoSubmodule<StreamRoleService>
public partial class StreamRoleCommands : NadekoModule<StreamRoleService>
{
[Cmd]
[BotPerm(GuildPerm.ManageRoles)]

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class UnitConverterCommands : NadekoSubmodule<ConverterService>
public partial class UnitConverterCommands : NadekoModule<ConverterService>
{
[Cmd]
public async partial Task ConvertList()

View File

@@ -6,7 +6,7 @@ namespace NadekoBot.Modules.Utility;
public partial class Utility
{
[Group]
public partial class VerboseErrorCommands : NadekoSubmodule<VerboseErrorsService>
public partial class VerboseErrorCommands : NadekoModule<VerboseErrorsService>
{
[Cmd]
[RequireContext(ContextType.Guild)]

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Xp;
public partial class Xp
{
[Group]
public partial class Club : NadekoSubmodule<ClubService>
public partial class Club : NadekoModule<ClubService>
{
private readonly XpService _xps;

View File

@@ -5,7 +5,7 @@ namespace NadekoBot.Modules.Xp;
public partial class Xp
{
public partial class ResetCommands : NadekoSubmodule<XpService>
public partial class ResetCommands : NadekoModule<XpService>
{
[Cmd]
[RequireContext(ContextType.Guild)]