mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-01 19:49:55 +03:00
Seal implicitly used classes (#309)
Apparently the `[UsedImplicitly]` annotation suppresses the "Class has no inheritors and can be marked sealed" warning. Cool to know. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
ebcdcb35f7
commit
d03e2504fc
19 changed files with 21 additions and 21 deletions
|
@ -25,7 +25,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles the command to show information about this bot: /about.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class AboutCommandGroup : CommandGroup
|
||||
public sealed class AboutCommandGroup : CommandGroup
|
||||
{
|
||||
private static readonly (string Username, Snowflake Id)[] Developers =
|
||||
[
|
||||
|
@ -36,9 +36,9 @@ public class AboutCommandGroup : CommandGroup
|
|||
|
||||
private readonly ICommandContext _context;
|
||||
private readonly IFeedbackService _feedback;
|
||||
private readonly IDiscordRestGuildAPI _guildApi;
|
||||
private readonly GuildDataService _guildData;
|
||||
private readonly IDiscordRestUserAPI _userApi;
|
||||
private readonly IDiscordRestGuildAPI _guildApi;
|
||||
|
||||
public AboutCommandGroup(
|
||||
ICommandContext context, GuildDataService guildData,
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles commands related to ban management: /ban and /unban.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class BanCommandGroup : CommandGroup
|
||||
public sealed class BanCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly AccessControlService _access;
|
||||
private readonly IDiscordRestChannelAPI _channelApi;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles the command to clear messages in a channel: /clear.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class ClearCommandGroup : CommandGroup
|
||||
public sealed class ClearCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly IDiscordRestChannelAPI _channelApi;
|
||||
private readonly ICommandContext _context;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace TeamOctolings.Octobot.Commands.Events;
|
|||
/// Handles error logging for slash command groups.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
|
||||
public sealed class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
|
||||
{
|
||||
private readonly IFeedbackService _feedback;
|
||||
private readonly ILogger<ErrorLoggingPostExecutionEvent> _logger;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace TeamOctolings.Octobot.Commands.Events;
|
|||
/// Handles error logging for slash commands that couldn't be successfully prepared.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class LoggingPreparationErrorEvent : IPreparationErrorEvent
|
||||
public sealed class LoggingPreparationErrorEvent : IPreparationErrorEvent
|
||||
{
|
||||
private readonly ILogger<LoggingPreparationErrorEvent> _logger;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles info commands: /userinfo, /guildinfo.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class InfoCommandGroup : CommandGroup
|
||||
public sealed class InfoCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly ICommandContext _context;
|
||||
private readonly IFeedbackService _feedback;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles the command to kick members of a guild: /kick.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class KickCommandGroup : CommandGroup
|
||||
public sealed class KickCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly AccessControlService _access;
|
||||
private readonly IDiscordRestChannelAPI _channelApi;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles commands related to mute management: /mute and /unmute.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class MuteCommandGroup : CommandGroup
|
||||
public sealed class MuteCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly AccessControlService _access;
|
||||
private readonly ICommandContext _context;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles the command to get the time taken for the gateway to respond to the last heartbeat: /ping
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class PingCommandGroup : CommandGroup
|
||||
public sealed class PingCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly IDiscordRestChannelAPI _channelApi;
|
||||
private readonly DiscordGatewayClient _client;
|
||||
|
|
|
@ -25,13 +25,13 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles commands to manage reminders: /remind, /listremind, /delremind
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class RemindCommandGroup : CommandGroup
|
||||
public sealed class RemindCommandGroup : CommandGroup
|
||||
{
|
||||
private readonly IInteractionCommandContext _context;
|
||||
private readonly IFeedbackService _feedback;
|
||||
private readonly GuildDataService _guildData;
|
||||
private readonly IDiscordRestUserAPI _userApi;
|
||||
private readonly IDiscordRestInteractionAPI _interactionApi;
|
||||
private readonly IDiscordRestUserAPI _userApi;
|
||||
|
||||
public RemindCommandGroup(
|
||||
IInteractionCommandContext context, GuildDataService guildData, IFeedbackService feedback,
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles the commands to list and modify per-guild settings: /settings and /settings list.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class SettingsCommandGroup : CommandGroup
|
||||
public sealed class SettingsCommandGroup : CommandGroup
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents all options as an array of objects implementing <see cref="IGuildOption" />.
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace TeamOctolings.Octobot.Commands;
|
|||
/// Handles tool commands: /random, /timestamp, /8ball.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class ToolsCommandGroup : CommandGroup
|
||||
public sealed class ToolsCommandGroup : CommandGroup
|
||||
{
|
||||
private static readonly TimestampStyle[] AllStyles =
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue