diff --git a/Octobot.sln b/Octobot.sln index 9dd2b89..b82f7a9 100644 --- a/Octobot.sln +++ b/Octobot.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octobot", "Octobot.csproj", "{9CA7A44F-167C-46D4-923D-88CE71044144}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamOctolings.Octobot", "TeamOctolings.Octobot\TeamOctolings.Octobot.csproj", "{A1679BA2-3A36-4D98-80C0-EEE771398FBD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -8,9 +8,9 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9CA7A44F-167C-46D4-923D-88CE71044144}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9CA7A44F-167C-46D4-923D-88CE71044144}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9CA7A44F-167C-46D4-923D-88CE71044144}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9CA7A44F-167C-46D4-923D-88CE71044144}.Release|Any CPU.Build.0 = Release|Any CPU + {A1679BA2-3A36-4D98-80C0-EEE771398FBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1679BA2-3A36-4D98-80C0-EEE771398FBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1679BA2-3A36-4D98-80C0-EEE771398FBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1679BA2-3A36-4D98-80C0-EEE771398FBD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Attributes/StaticCallersOnlyAttribute.cs b/TeamOctolings.Octobot/Attributes/StaticCallersOnlyAttribute.cs similarity index 88% rename from src/Attributes/StaticCallersOnlyAttribute.cs rename to TeamOctolings.Octobot/Attributes/StaticCallersOnlyAttribute.cs index e8787bf..0256f62 100644 --- a/src/Attributes/StaticCallersOnlyAttribute.cs +++ b/TeamOctolings.Octobot/Attributes/StaticCallersOnlyAttribute.cs @@ -1,4 +1,4 @@ -namespace Octobot.Attributes; +namespace TeamOctolings.Octobot.Attributes; /// /// Any property marked with should only be accessed by static methods. diff --git a/src/BuildInfo.cs b/TeamOctolings.Octobot/BuildInfo.cs similarity index 93% rename from src/BuildInfo.cs rename to TeamOctolings.Octobot/BuildInfo.cs index 2eb6059..4b9a09f 100644 --- a/src/BuildInfo.cs +++ b/TeamOctolings.Octobot/BuildInfo.cs @@ -1,4 +1,4 @@ -namespace Octobot; +namespace TeamOctolings.Octobot; public static class BuildInfo { diff --git a/src/ColorsList.cs b/TeamOctolings.Octobot/ColorsList.cs similarity index 95% rename from src/ColorsList.cs rename to TeamOctolings.Octobot/ColorsList.cs index cd40313..3b66c0a 100644 --- a/src/ColorsList.cs +++ b/TeamOctolings.Octobot/ColorsList.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Octobot; +namespace TeamOctolings.Octobot; /// /// Contains all colors used in embeds. diff --git a/src/Commands/AboutCommandGroup.cs b/TeamOctolings.Octobot/Commands/AboutCommandGroup.cs similarity index 97% rename from src/Commands/AboutCommandGroup.cs rename to TeamOctolings.Octobot/Commands/AboutCommandGroup.cs index 02384f8..9f05af3 100644 --- a/src/Commands/AboutCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/AboutCommandGroup.cs @@ -1,9 +1,6 @@ using System.ComponentModel; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -18,8 +15,11 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles the command to show information about this bot: /about. diff --git a/src/Commands/BanCommandGroup.cs b/TeamOctolings.Octobot/Commands/BanCommandGroup.cs similarity index 98% rename from src/Commands/BanCommandGroup.cs rename to TeamOctolings.Octobot/Commands/BanCommandGroup.cs index 02a377a..8d90286 100644 --- a/src/Commands/BanCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/BanCommandGroup.cs @@ -2,11 +2,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Parsers; -using Octobot.Services; -using Octobot.Services.Update; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -19,8 +14,13 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Parsers; +using TeamOctolings.Octobot.Services; +using TeamOctolings.Octobot.Services.Update; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles commands related to ban management: /ban and /unban. diff --git a/src/Commands/ClearCommandGroup.cs b/TeamOctolings.Octobot/Commands/ClearCommandGroup.cs similarity index 97% rename from src/Commands/ClearCommandGroup.cs rename to TeamOctolings.Octobot/Commands/ClearCommandGroup.cs index 84b69db..8a8cb2f 100644 --- a/src/Commands/ClearCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/ClearCommandGroup.cs @@ -1,9 +1,6 @@ using System.ComponentModel; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -16,8 +13,11 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles the command to clear messages in a channel: /clear. diff --git a/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs b/TeamOctolings.Octobot/Commands/Events/ErrorLoggingPostExecutionEvent.cs similarity index 97% rename from src/Commands/Events/ErrorLoggingPostExecutionEvent.cs rename to TeamOctolings.Octobot/Commands/Events/ErrorLoggingPostExecutionEvent.cs index 551c2d0..7ffc4fe 100644 --- a/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs +++ b/TeamOctolings.Octobot/Commands/Events/ErrorLoggingPostExecutionEvent.cs @@ -1,6 +1,5 @@ using JetBrains.Annotations; using Microsoft.Extensions.Logging; -using Octobot.Extensions; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; using Remora.Discord.API.Objects; @@ -11,8 +10,9 @@ using Remora.Discord.Commands.Services; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Results; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Commands.Events; +namespace TeamOctolings.Octobot.Commands.Events; /// /// Handles error logging for slash command groups. diff --git a/src/Commands/Events/LoggingPreparationErrorEvent.cs b/TeamOctolings.Octobot/Commands/Events/LoggingPreparationErrorEvent.cs similarity index 93% rename from src/Commands/Events/LoggingPreparationErrorEvent.cs rename to TeamOctolings.Octobot/Commands/Events/LoggingPreparationErrorEvent.cs index 87b4090..10a6a1f 100644 --- a/src/Commands/Events/LoggingPreparationErrorEvent.cs +++ b/TeamOctolings.Octobot/Commands/Events/LoggingPreparationErrorEvent.cs @@ -1,11 +1,11 @@ using JetBrains.Annotations; using Microsoft.Extensions.Logging; -using Octobot.Extensions; using Remora.Discord.Commands.Contexts; using Remora.Discord.Commands.Services; using Remora.Results; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Commands.Events; +namespace TeamOctolings.Octobot.Commands.Events; /// /// Handles error logging for slash commands that couldn't be successfully prepared. diff --git a/src/Commands/KickCommandGroup.cs b/TeamOctolings.Octobot/Commands/KickCommandGroup.cs similarity index 97% rename from src/Commands/KickCommandGroup.cs rename to TeamOctolings.Octobot/Commands/KickCommandGroup.cs index 87b915a..4252232 100644 --- a/src/Commands/KickCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/KickCommandGroup.cs @@ -1,9 +1,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -15,8 +12,11 @@ using Remora.Discord.Commands.Feedback.Services; using Remora.Discord.Extensions.Embeds; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles the command to kick members of a guild: /kick. diff --git a/src/Commands/MuteCommandGroup.cs b/TeamOctolings.Octobot/Commands/MuteCommandGroup.cs similarity index 98% rename from src/Commands/MuteCommandGroup.cs rename to TeamOctolings.Octobot/Commands/MuteCommandGroup.cs index ce0a296..8e449f7 100644 --- a/src/Commands/MuteCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/MuteCommandGroup.cs @@ -2,11 +2,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Parsers; -using Octobot.Services; -using Octobot.Services.Update; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -19,8 +14,13 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Parsers; +using TeamOctolings.Octobot.Services; +using TeamOctolings.Octobot.Services.Update; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles commands related to mute management: /mute and /unmute. diff --git a/src/Commands/PingCommandGroup.cs b/TeamOctolings.Octobot/Commands/PingCommandGroup.cs similarity index 96% rename from src/Commands/PingCommandGroup.cs rename to TeamOctolings.Octobot/Commands/PingCommandGroup.cs index d64c6dd..70b9f23 100644 --- a/src/Commands/PingCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/PingCommandGroup.cs @@ -1,8 +1,5 @@ using System.ComponentModel; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -15,8 +12,11 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Gateway; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles the command to get the time taken for the gateway to respond to the last heartbeat: /ping diff --git a/src/Commands/RemindCommandGroup.cs b/TeamOctolings.Octobot/Commands/RemindCommandGroup.cs similarity index 98% rename from src/Commands/RemindCommandGroup.cs rename to TeamOctolings.Octobot/Commands/RemindCommandGroup.cs index aa1ef7e..f40ba6b 100644 --- a/src/Commands/RemindCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/RemindCommandGroup.cs @@ -2,9 +2,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -17,9 +14,12 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; -using Octobot.Parsers; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Parsers; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles commands to manage reminders: /remind, /listremind, /delremind diff --git a/src/Commands/SettingsCommandGroup.cs b/TeamOctolings.Octobot/Commands/SettingsCommandGroup.cs similarity index 96% rename from src/Commands/SettingsCommandGroup.cs rename to TeamOctolings.Octobot/Commands/SettingsCommandGroup.cs index a39e9c7..56584bf 100644 --- a/src/Commands/SettingsCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/SettingsCommandGroup.cs @@ -3,10 +3,6 @@ using System.ComponentModel.DataAnnotations; using System.Text; using System.Text.Json.Nodes; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Data.Options; -using Octobot.Extensions; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -19,8 +15,12 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Data.Options; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles the commands to list and modify per-guild settings: /settings and /settings list. @@ -29,13 +29,13 @@ namespace Octobot.Commands; public class SettingsCommandGroup : CommandGroup { /// - /// Represents all options as an array of objects implementing . + /// Represents all options as an array of objects implementing . /// /// /// WARNING: If you update this array in any way, you must also update and make sure /// that the orders match. /// - private static readonly IOption[] AllOptions = + private static readonly IGuildOption[] AllOptions = [ GuildSettings.Language, GuildSettings.WelcomeMessage, @@ -199,7 +199,7 @@ public class SettingsCommandGroup : CommandGroup } private async Task EditSettingAsync( - IOption option, string value, GuildData data, Snowflake channelId, IUser executor, IUser bot, + IGuildOption option, string value, GuildData data, Snowflake channelId, IUser executor, IUser bot, CancellationToken ct = default) { var setResult = option.Set(data.Settings, value); @@ -270,7 +270,7 @@ public class SettingsCommandGroup : CommandGroup } private async Task ResetSingleSettingAsync(JsonNode cfg, IUser bot, - IOption option, CancellationToken ct = default) + IGuildOption option, CancellationToken ct = default) { var resetResult = option.Reset(cfg); if (!resetResult.IsSuccess) diff --git a/src/Commands/ToolsCommandGroup.cs b/TeamOctolings.Octobot/Commands/ToolsCommandGroup.cs similarity index 99% rename from src/Commands/ToolsCommandGroup.cs rename to TeamOctolings.Octobot/Commands/ToolsCommandGroup.cs index d4f3f75..3e84527 100644 --- a/src/Commands/ToolsCommandGroup.cs +++ b/TeamOctolings.Octobot/Commands/ToolsCommandGroup.cs @@ -2,10 +2,6 @@ using System.ComponentModel; using System.Drawing; using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Parsers; -using Octobot.Services; using Remora.Commands.Attributes; using Remora.Commands.Groups; using Remora.Discord.API.Abstractions.Objects; @@ -17,8 +13,12 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Parsers; +using TeamOctolings.Octobot.Services; -namespace Octobot.Commands; +namespace TeamOctolings.Octobot.Commands; /// /// Handles tool commands: /userinfo, /guildinfo, /random, /timestamp, /8ball. diff --git a/src/Data/GuildData.cs b/TeamOctolings.Octobot/Data/GuildData.cs similarity index 97% rename from src/Data/GuildData.cs rename to TeamOctolings.Octobot/Data/GuildData.cs index 5a903d6..f393323 100644 --- a/src/Data/GuildData.cs +++ b/TeamOctolings.Octobot/Data/GuildData.cs @@ -1,7 +1,7 @@ using System.Text.Json.Nodes; using Remora.Rest.Core; -namespace Octobot.Data; +namespace TeamOctolings.Octobot.Data; /// /// Stores information about a guild. This information is not accessible via the Discord API. diff --git a/src/Data/GuildSettings.cs b/TeamOctolings.Octobot/Data/GuildSettings.cs similarity index 92% rename from src/Data/GuildSettings.cs rename to TeamOctolings.Octobot/Data/GuildSettings.cs index a1d8d74..dc59d6f 100644 --- a/src/Data/GuildSettings.cs +++ b/TeamOctolings.Octobot/Data/GuildSettings.cs @@ -1,8 +1,8 @@ -using Octobot.Data.Options; -using Octobot.Responders; using Remora.Discord.API.Abstractions.Objects; +using TeamOctolings.Octobot.Data.Options; +using TeamOctolings.Octobot.Responders; -namespace Octobot.Data; +namespace TeamOctolings.Octobot.Data; /// /// Contains all per-guild settings that can be set by a member @@ -22,7 +22,7 @@ public static class GuildSettings /// /// /// - public static readonly Option WelcomeMessage = new("WelcomeMessage", "default"); + public static readonly GuildOption WelcomeMessage = new("WelcomeMessage", "default"); /// /// Controls what message should be sent in when a member leaves the guild. @@ -34,7 +34,7 @@ public static class GuildSettings /// /// /// - public static readonly Option LeaveMessage = new("LeaveMessage", "default"); + public static readonly GuildOption LeaveMessage = new("LeaveMessage", "default"); /// /// Controls whether or not the message should be sent diff --git a/src/Data/MemberData.cs b/TeamOctolings.Octobot/Data/MemberData.cs similarity index 93% rename from src/Data/MemberData.cs rename to TeamOctolings.Octobot/Data/MemberData.cs index 1b3d0d9..984d4af 100644 --- a/src/Data/MemberData.cs +++ b/TeamOctolings.Octobot/Data/MemberData.cs @@ -1,4 +1,4 @@ -namespace Octobot.Data; +namespace TeamOctolings.Octobot.Data; /// /// Stores information about a member diff --git a/src/Data/Options/AllOptionsEnum.cs b/TeamOctolings.Octobot/Data/Options/AllOptionsEnum.cs similarity index 92% rename from src/Data/Options/AllOptionsEnum.cs rename to TeamOctolings.Octobot/Data/Options/AllOptionsEnum.cs index d9e0c13..6a4280e 100644 --- a/src/Data/Options/AllOptionsEnum.cs +++ b/TeamOctolings.Octobot/Data/Options/AllOptionsEnum.cs @@ -1,7 +1,7 @@ using JetBrains.Annotations; -using Octobot.Commands; +using TeamOctolings.Octobot.Commands; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; /// /// Represents all options as enums. diff --git a/src/Data/Options/BoolOption.cs b/TeamOctolings.Octobot/Data/Options/BoolOption.cs similarity index 91% rename from src/Data/Options/BoolOption.cs rename to TeamOctolings.Octobot/Data/Options/BoolOption.cs index 6876164..6a3c899 100644 --- a/src/Data/Options/BoolOption.cs +++ b/TeamOctolings.Octobot/Data/Options/BoolOption.cs @@ -1,9 +1,9 @@ using System.Text.Json.Nodes; using Remora.Results; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; -public sealed class BoolOption : Option +public sealed class BoolOption : GuildOption { public BoolOption(string name, bool defaultValue) : base(name, defaultValue) { } diff --git a/src/Data/Options/Option.cs b/TeamOctolings.Octobot/Data/Options/GuildOption.cs similarity index 90% rename from src/Data/Options/Option.cs rename to TeamOctolings.Octobot/Data/Options/GuildOption.cs index 5d703a8..5d9f1a2 100644 --- a/src/Data/Options/Option.cs +++ b/TeamOctolings.Octobot/Data/Options/GuildOption.cs @@ -2,18 +2,18 @@ using System.Text.Json.Nodes; using Remora.Discord.Extensions.Formatting; using Remora.Results; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; /// -/// Represents an per-guild option. +/// Represents a per-guild option. /// /// The type of the option. -public class Option : IOption +public class GuildOption : IGuildOption where T : notnull { protected readonly T DefaultValue; - public Option(string name, T defaultValue) + public GuildOption(string name, T defaultValue) { Name = name; DefaultValue = defaultValue; diff --git a/src/Data/Options/IOption.cs b/TeamOctolings.Octobot/Data/Options/IGuildOption.cs similarity index 73% rename from src/Data/Options/IOption.cs rename to TeamOctolings.Octobot/Data/Options/IGuildOption.cs index b8ed03c..a8c3e6e 100644 --- a/src/Data/Options/IOption.cs +++ b/TeamOctolings.Octobot/Data/Options/IGuildOption.cs @@ -1,9 +1,9 @@ using System.Text.Json.Nodes; using Remora.Results; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; -public interface IOption +public interface IGuildOption { string Name { get; } string Display(JsonNode settings); diff --git a/src/Data/Options/LanguageOption.cs b/TeamOctolings.Octobot/Data/Options/LanguageOption.cs similarity index 91% rename from src/Data/Options/LanguageOption.cs rename to TeamOctolings.Octobot/Data/Options/LanguageOption.cs index 22f98df..15ab6ff 100644 --- a/src/Data/Options/LanguageOption.cs +++ b/TeamOctolings.Octobot/Data/Options/LanguageOption.cs @@ -3,10 +3,10 @@ using System.Text.Json.Nodes; using Remora.Discord.Extensions.Formatting; using Remora.Results; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; /// -public sealed class LanguageOption : Option +public sealed class LanguageOption : GuildOption { private static readonly Dictionary CultureInfoCache = new() { diff --git a/src/Data/Options/SnowflakeOption.cs b/TeamOctolings.Octobot/Data/Options/SnowflakeOption.cs similarity index 87% rename from src/Data/Options/SnowflakeOption.cs rename to TeamOctolings.Octobot/Data/Options/SnowflakeOption.cs index 7118da8..b7405f2 100644 --- a/src/Data/Options/SnowflakeOption.cs +++ b/TeamOctolings.Octobot/Data/Options/SnowflakeOption.cs @@ -1,13 +1,13 @@ using System.Text.Json.Nodes; using System.Text.RegularExpressions; -using Octobot.Extensions; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; -public sealed partial class SnowflakeOption : Option +public sealed partial class SnowflakeOption : GuildOption { public SnowflakeOption(string name) : base(name, 0UL.ToSnowflake()) { } diff --git a/src/Data/Options/TimeSpanOption.cs b/TeamOctolings.Octobot/Data/Options/TimeSpanOption.cs similarity index 82% rename from src/Data/Options/TimeSpanOption.cs rename to TeamOctolings.Octobot/Data/Options/TimeSpanOption.cs index d237b6e..3501f09 100644 --- a/src/Data/Options/TimeSpanOption.cs +++ b/TeamOctolings.Octobot/Data/Options/TimeSpanOption.cs @@ -1,10 +1,10 @@ using System.Text.Json.Nodes; -using Octobot.Parsers; using Remora.Results; +using TeamOctolings.Octobot.Parsers; -namespace Octobot.Data.Options; +namespace TeamOctolings.Octobot.Data.Options; -public sealed class TimeSpanOption : Option +public sealed class TimeSpanOption : GuildOption { public TimeSpanOption(string name, TimeSpan defaultValue) : base(name, defaultValue) { } diff --git a/src/Data/Reminder.cs b/TeamOctolings.Octobot/Data/Reminder.cs similarity index 83% rename from src/Data/Reminder.cs rename to TeamOctolings.Octobot/Data/Reminder.cs index f21b222..c3936da 100644 --- a/src/Data/Reminder.cs +++ b/TeamOctolings.Octobot/Data/Reminder.cs @@ -1,4 +1,4 @@ -namespace Octobot.Data; +namespace TeamOctolings.Octobot.Data; public struct Reminder { diff --git a/src/Data/ScheduledEventData.cs b/TeamOctolings.Octobot/Data/ScheduledEventData.cs similarity index 97% rename from src/Data/ScheduledEventData.cs rename to TeamOctolings.Octobot/Data/ScheduledEventData.cs index 59efc63..7ba6e92 100644 --- a/src/Data/ScheduledEventData.cs +++ b/TeamOctolings.Octobot/Data/ScheduledEventData.cs @@ -1,7 +1,7 @@ using System.Text.Json.Serialization; using Remora.Discord.API.Abstractions.Objects; -namespace Octobot.Data; +namespace TeamOctolings.Octobot.Data; /// /// Stores information about scheduled events. This information is not provided by the Discord API. diff --git a/src/Extensions/ChannelApiExtensions.cs b/TeamOctolings.Octobot/Extensions/ChannelApiExtensions.cs similarity index 96% rename from src/Extensions/ChannelApiExtensions.cs rename to TeamOctolings.Octobot/Extensions/ChannelApiExtensions.cs index 99eff67..2767f96 100644 --- a/src/Extensions/ChannelApiExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/ChannelApiExtensions.cs @@ -5,7 +5,7 @@ using Remora.Discord.API.Objects; using Remora.Rest.Core; using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class ChannelApiExtensions { diff --git a/src/Extensions/CollectionExtensions.cs b/TeamOctolings.Octobot/Extensions/CollectionExtensions.cs similarity index 96% rename from src/Extensions/CollectionExtensions.cs rename to TeamOctolings.Octobot/Extensions/CollectionExtensions.cs index 2369532..3ea13a8 100644 --- a/src/Extensions/CollectionExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/CollectionExtensions.cs @@ -1,6 +1,6 @@ using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class CollectionExtensions { diff --git a/src/Extensions/CommandContextExtensions.cs b/TeamOctolings.Octobot/Extensions/CommandContextExtensions.cs similarity index 92% rename from src/Extensions/CommandContextExtensions.cs rename to TeamOctolings.Octobot/Extensions/CommandContextExtensions.cs index a0c02f2..16b8b56 100644 --- a/src/Extensions/CommandContextExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/CommandContextExtensions.cs @@ -2,7 +2,7 @@ using Remora.Discord.Commands.Extensions; using Remora.Rest.Core; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class CommandContextExtensions { diff --git a/src/Extensions/DiffPaneModelExtensions.cs b/TeamOctolings.Octobot/Extensions/DiffPaneModelExtensions.cs similarity index 94% rename from src/Extensions/DiffPaneModelExtensions.cs rename to TeamOctolings.Octobot/Extensions/DiffPaneModelExtensions.cs index 1c3a098..3bb707b 100644 --- a/src/Extensions/DiffPaneModelExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/DiffPaneModelExtensions.cs @@ -1,7 +1,7 @@ using System.Text; using DiffPlex.DiffBuilder.Model; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class DiffPaneModelExtensions { diff --git a/src/Extensions/EmbedBuilderExtensions.cs b/TeamOctolings.Octobot/Extensions/EmbedBuilderExtensions.cs similarity index 99% rename from src/Extensions/EmbedBuilderExtensions.cs rename to TeamOctolings.Octobot/Extensions/EmbedBuilderExtensions.cs index 2d61403..dab0265 100644 --- a/src/Extensions/EmbedBuilderExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/EmbedBuilderExtensions.cs @@ -4,7 +4,7 @@ using Remora.Discord.API.Objects; using Remora.Discord.Extensions.Embeds; using Remora.Rest.Core; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class EmbedBuilderExtensions { diff --git a/src/Extensions/FeedbackServiceExtensions.cs b/TeamOctolings.Octobot/Extensions/FeedbackServiceExtensions.cs similarity index 93% rename from src/Extensions/FeedbackServiceExtensions.cs rename to TeamOctolings.Octobot/Extensions/FeedbackServiceExtensions.cs index e6ef376..c66c946 100644 --- a/src/Extensions/FeedbackServiceExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/FeedbackServiceExtensions.cs @@ -3,7 +3,7 @@ using Remora.Discord.Commands.Feedback.Messages; using Remora.Discord.Commands.Feedback.Services; using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class FeedbackServiceExtensions { diff --git a/src/Extensions/GuildScheduledEventExtensions.cs b/TeamOctolings.Octobot/Extensions/GuildScheduledEventExtensions.cs similarity index 95% rename from src/Extensions/GuildScheduledEventExtensions.cs rename to TeamOctolings.Octobot/Extensions/GuildScheduledEventExtensions.cs index f1b6985..b8eb2d1 100644 --- a/src/Extensions/GuildScheduledEventExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/GuildScheduledEventExtensions.cs @@ -2,7 +2,7 @@ using Remora.Rest.Core; using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class GuildScheduledEventExtensions { diff --git a/src/Extensions/LoggerExtensions.cs b/TeamOctolings.Octobot/Extensions/LoggerExtensions.cs similarity index 96% rename from src/Extensions/LoggerExtensions.cs rename to TeamOctolings.Octobot/Extensions/LoggerExtensions.cs index fca3702..76fa386 100644 --- a/src/Extensions/LoggerExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/LoggerExtensions.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class LoggerExtensions { diff --git a/src/Extensions/MarkdownExtensions.cs b/TeamOctolings.Octobot/Extensions/MarkdownExtensions.cs similarity index 88% rename from src/Extensions/MarkdownExtensions.cs rename to TeamOctolings.Octobot/Extensions/MarkdownExtensions.cs index 7b7f780..202cd37 100644 --- a/src/Extensions/MarkdownExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/MarkdownExtensions.cs @@ -1,4 +1,4 @@ -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class MarkdownExtensions { diff --git a/src/Extensions/ResultExtensions.cs b/TeamOctolings.Octobot/Extensions/ResultExtensions.cs similarity index 82% rename from src/Extensions/ResultExtensions.cs rename to TeamOctolings.Octobot/Extensions/ResultExtensions.cs index a95a1e2..d7ef7d7 100644 --- a/src/Extensions/ResultExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/ResultExtensions.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; using Remora.Results; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class ResultExtensions { @@ -23,18 +23,23 @@ public static class ResultExtensions private static void LogResultStackTrace(Result result) { - if (Octobot.StaticLogger is null || result.IsSuccess) + if (result.IsSuccess) { return; } - Octobot.StaticLogger.LogError("{ErrorType}: {ErrorMessage}{NewLine}{StackTrace}", + if (Utility.StaticLogger is null) + { + throw new InvalidOperationException(); + } + + Utility.StaticLogger.LogError("{ErrorType}: {ErrorMessage}{NewLine}{StackTrace}", result.Error.GetType().FullName, result.Error.Message, Environment.NewLine, ConstructStackTrace()); var inner = result.Inner; while (inner is { IsSuccess: false }) { - Octobot.StaticLogger.LogError("Caused by: {ResultType}: {ResultMessage}", + Utility.StaticLogger.LogError("Caused by: {ResultType}: {ResultMessage}", inner.Error.GetType().FullName, inner.Error.Message); inner = inner.Inner; diff --git a/src/Extensions/SnowflakeExtensions.cs b/TeamOctolings.Octobot/Extensions/SnowflakeExtensions.cs similarity index 96% rename from src/Extensions/SnowflakeExtensions.cs rename to TeamOctolings.Octobot/Extensions/SnowflakeExtensions.cs index e60bc44..70810ef 100644 --- a/src/Extensions/SnowflakeExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/SnowflakeExtensions.cs @@ -1,6 +1,6 @@ using Remora.Rest.Core; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class SnowflakeExtensions { diff --git a/src/Extensions/StringBuilderExtensions.cs b/TeamOctolings.Octobot/Extensions/StringBuilderExtensions.cs similarity index 98% rename from src/Extensions/StringBuilderExtensions.cs rename to TeamOctolings.Octobot/Extensions/StringBuilderExtensions.cs index ddd24a3..25b7b5b 100644 --- a/src/Extensions/StringBuilderExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/StringBuilderExtensions.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class StringBuilderExtensions { diff --git a/src/Extensions/StringExtensions.cs b/TeamOctolings.Octobot/Extensions/StringExtensions.cs similarity index 98% rename from src/Extensions/StringExtensions.cs rename to TeamOctolings.Octobot/Extensions/StringExtensions.cs index cb8d606..bf7f6c8 100644 --- a/src/Extensions/StringExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/StringExtensions.cs @@ -1,7 +1,7 @@ using System.Net; using Remora.Discord.Extensions.Formatting; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class StringExtensions { diff --git a/src/Extensions/UInt64Extensions.cs b/TeamOctolings.Octobot/Extensions/UInt64Extensions.cs similarity index 82% rename from src/Extensions/UInt64Extensions.cs rename to TeamOctolings.Octobot/Extensions/UInt64Extensions.cs index 5d1db00..2b9c0a2 100644 --- a/src/Extensions/UInt64Extensions.cs +++ b/TeamOctolings.Octobot/Extensions/UInt64Extensions.cs @@ -1,7 +1,7 @@ using Remora.Discord.API; using Remora.Rest.Core; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class UInt64Extensions { diff --git a/src/Extensions/UserExtensions.cs b/TeamOctolings.Octobot/Extensions/UserExtensions.cs similarity index 85% rename from src/Extensions/UserExtensions.cs rename to TeamOctolings.Octobot/Extensions/UserExtensions.cs index 38fe985..d9eff33 100644 --- a/src/Extensions/UserExtensions.cs +++ b/TeamOctolings.Octobot/Extensions/UserExtensions.cs @@ -1,6 +1,6 @@ using Remora.Discord.API.Abstractions.Objects; -namespace Octobot.Extensions; +namespace TeamOctolings.Octobot.Extensions; public static class UserExtensions { diff --git a/src/Messages.Designer.cs b/TeamOctolings.Octobot/Messages.Designer.cs similarity index 89% rename from src/Messages.Designer.cs rename to TeamOctolings.Octobot/Messages.Designer.cs index 2910bae..bbc1366 100644 --- a/src/Messages.Designer.cs +++ b/TeamOctolings.Octobot/Messages.Designer.cs @@ -7,31 +7,34 @@ // //------------------------------------------------------------------------------ -namespace Octobot { +namespace TeamOctolings.Octobot { + using System; + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Messages { - + private static System.Resources.ResourceManager resourceMan; - + private static System.Globalization.CultureInfo resourceCulture; - + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Messages() { } - + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Resources.ResourceManager ResourceManager { get { if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Octobot.locale.Messages", typeof(Messages).Assembly); + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("TeamOctolings.Octobot.Messages", typeof(Messages).Assembly); resourceMan = temp; } return resourceMan; } } - + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Globalization.CultureInfo Culture { get { @@ -41,1180 +44,1157 @@ namespace Octobot { resourceCulture = value; } } - + internal static string Ready { get { return ResourceManager.GetString("Ready", resourceCulture); } } - + internal static string CachedMessageDeleted { get { return ResourceManager.GetString("CachedMessageDeleted", resourceCulture); } } - + internal static string CachedMessageEdited { get { return ResourceManager.GetString("CachedMessageEdited", resourceCulture); } } - + internal static string DefaultWelcomeMessage { get { return ResourceManager.GetString("DefaultWelcomeMessage", resourceCulture); } } - + internal static string Generic1 { get { return ResourceManager.GetString("Generic1", resourceCulture); } } - + internal static string Generic2 { get { return ResourceManager.GetString("Generic2", resourceCulture); } } - + internal static string Generic3 { get { return ResourceManager.GetString("Generic3", resourceCulture); } } - + internal static string YouWereBanned { get { return ResourceManager.GetString("YouWereBanned", resourceCulture); } } - + internal static string PunishmentExpired { get { return ResourceManager.GetString("PunishmentExpired", resourceCulture); } } - + internal static string YouWereKicked { get { return ResourceManager.GetString("YouWereKicked", resourceCulture); } } - + internal static string Milliseconds { get { return ResourceManager.GetString("Milliseconds", resourceCulture); } } - + internal static string ChannelNotSpecified { get { return ResourceManager.GetString("ChannelNotSpecified", resourceCulture); } } - + internal static string RoleNotSpecified { get { return ResourceManager.GetString("RoleNotSpecified", resourceCulture); } } - - internal static string SettingsLang { + + internal static string SettingsLanguage { get { - return ResourceManager.GetString("SettingsLang", resourceCulture); + return ResourceManager.GetString("SettingsLanguage", resourceCulture); } } - + internal static string SettingsPrefix { get { return ResourceManager.GetString("SettingsPrefix", resourceCulture); } } - + internal static string SettingsRemoveRolesOnMute { get { return ResourceManager.GetString("SettingsRemoveRolesOnMute", resourceCulture); } } - + internal static string SettingsSendWelcomeMessages { get { return ResourceManager.GetString("SettingsSendWelcomeMessages", resourceCulture); } } - + internal static string SettingsMuteRole { get { return ResourceManager.GetString("SettingsMuteRole", resourceCulture); } } - + internal static string LanguageNotSupported { get { return ResourceManager.GetString("LanguageNotSupported", resourceCulture); } } - + internal static string Yes { get { return ResourceManager.GetString("Yes", resourceCulture); } } - + internal static string No { get { return ResourceManager.GetString("No", resourceCulture); } } - + internal static string UserNotBanned { get { return ResourceManager.GetString("UserNotBanned", resourceCulture); } } - + internal static string MemberNotMuted { get { return ResourceManager.GetString("MemberNotMuted", resourceCulture); } } - + internal static string SettingsWelcomeMessage { get { return ResourceManager.GetString("SettingsWelcomeMessage", resourceCulture); } } - + internal static string UserBanned { get { return ResourceManager.GetString("UserBanned", resourceCulture); } } - + internal static string SettingsReceiveStartupMessages { get { return ResourceManager.GetString("SettingsReceiveStartupMessages", resourceCulture); } } - + internal static string InvalidSettingValue { get { return ResourceManager.GetString("InvalidSettingValue", resourceCulture); } } - - internal static string InvalidRole { - get { - return ResourceManager.GetString("InvalidRole", resourceCulture); - } - } - - internal static string InvalidChannel { - get { - return ResourceManager.GetString("InvalidChannel", resourceCulture); - } - } - + internal static string DurationRequiredForTimeOuts { get { return ResourceManager.GetString("DurationRequiredForTimeOuts", resourceCulture); } } - + internal static string CannotTimeOutBot { get { return ResourceManager.GetString("CannotTimeOutBot", resourceCulture); } } - + internal static string SettingsEventNotificationRole { get { return ResourceManager.GetString("SettingsEventNotificationRole", resourceCulture); } } - + internal static string SettingsEventNotificationChannel { get { return ResourceManager.GetString("SettingsEventNotificationChannel", resourceCulture); } } - + internal static string SettingsEventStartedReceivers { get { return ResourceManager.GetString("SettingsEventStartedReceivers", resourceCulture); } } - + internal static string EventStarted { get { return ResourceManager.GetString("EventStarted", resourceCulture); } } - + internal static string EventCancelled { get { return ResourceManager.GetString("EventCancelled", resourceCulture); } } - + internal static string EventCompleted { get { return ResourceManager.GetString("EventCompleted", resourceCulture); } } - + internal static string MessagesCleared { get { return ResourceManager.GetString("MessagesCleared", resourceCulture); } } - + internal static string SettingsNothingChanged { get { return ResourceManager.GetString("SettingsNothingChanged", resourceCulture); } } - + internal static string SettingNotDefined { get { return ResourceManager.GetString("SettingNotDefined", resourceCulture); } } - + + internal static string MissingUser { + get { + return ResourceManager.GetString("MissingUser", resourceCulture); + } + } + internal static string UserCannotBanMembers { get { return ResourceManager.GetString("UserCannotBanMembers", resourceCulture); } } - + internal static string UserCannotManageMessages { get { return ResourceManager.GetString("UserCannotManageMessages", resourceCulture); } } - + internal static string UserCannotKickMembers { get { return ResourceManager.GetString("UserCannotKickMembers", resourceCulture); } } - - internal static string UserCannotModerateMembers { + + internal static string UserCannotMuteMembers { get { - return ResourceManager.GetString("UserCannotModerateMembers", resourceCulture); + return ResourceManager.GetString("UserCannotMuteMembers", resourceCulture); } } - + + internal static string UserCannotUnmuteMembers { + get { + return ResourceManager.GetString("UserCannotUnmuteMembers", resourceCulture); + } + } + internal static string UserCannotManageGuild { get { return ResourceManager.GetString("UserCannotManageGuild", resourceCulture); } } - + internal static string BotCannotBanMembers { get { return ResourceManager.GetString("BotCannotBanMembers", resourceCulture); } } - + internal static string BotCannotManageMessages { get { return ResourceManager.GetString("BotCannotManageMessages", resourceCulture); } } - + internal static string BotCannotKickMembers { get { return ResourceManager.GetString("BotCannotKickMembers", resourceCulture); } } - + internal static string BotCannotModerateMembers { get { return ResourceManager.GetString("BotCannotModerateMembers", resourceCulture); } } - + internal static string BotCannotManageGuild { get { return ResourceManager.GetString("BotCannotManageGuild", resourceCulture); } } - + internal static string UserCannotBanOwner { get { return ResourceManager.GetString("UserCannotBanOwner", resourceCulture); } } - + internal static string UserCannotBanThemselves { get { return ResourceManager.GetString("UserCannotBanThemselves", resourceCulture); } } - + internal static string UserCannotBanBot { get { return ResourceManager.GetString("UserCannotBanBot", resourceCulture); } } - + internal static string BotCannotBanTarget { get { return ResourceManager.GetString("BotCannotBanTarget", resourceCulture); } } - + internal static string UserCannotBanTarget { get { return ResourceManager.GetString("UserCannotBanTarget", resourceCulture); } } - + internal static string UserCannotKickOwner { get { return ResourceManager.GetString("UserCannotKickOwner", resourceCulture); } } - + internal static string UserCannotKickThemselves { get { return ResourceManager.GetString("UserCannotKickThemselves", resourceCulture); } } - + internal static string UserCannotKickBot { get { return ResourceManager.GetString("UserCannotKickBot", resourceCulture); } } - + internal static string BotCannotKickTarget { get { return ResourceManager.GetString("BotCannotKickTarget", resourceCulture); } } - + internal static string UserCannotKickTarget { get { return ResourceManager.GetString("UserCannotKickTarget", resourceCulture); } } - + internal static string UserCannotMuteOwner { get { return ResourceManager.GetString("UserCannotMuteOwner", resourceCulture); } } - + internal static string UserCannotMuteThemselves { get { return ResourceManager.GetString("UserCannotMuteThemselves", resourceCulture); } } - + internal static string UserCannotMuteBot { get { return ResourceManager.GetString("UserCannotMuteBot", resourceCulture); } } - + internal static string BotCannotMuteTarget { get { return ResourceManager.GetString("BotCannotMuteTarget", resourceCulture); } } - + internal static string UserCannotMuteTarget { get { return ResourceManager.GetString("UserCannotMuteTarget", resourceCulture); } } - + internal static string UserCannotUnmuteOwner { get { return ResourceManager.GetString("UserCannotUnmuteOwner", resourceCulture); } } - + internal static string UserCannotUnmuteThemselves { get { return ResourceManager.GetString("UserCannotUnmuteThemselves", resourceCulture); } } - + internal static string UserCannotUnmuteBot { get { return ResourceManager.GetString("UserCannotUnmuteBot", resourceCulture); } } - + internal static string BotCannotUnmuteTarget { get { return ResourceManager.GetString("BotCannotUnmuteTarget", resourceCulture); } } - + internal static string UserCannotUnmuteTarget { get { return ResourceManager.GetString("UserCannotUnmuteTarget", resourceCulture); } } - + internal static string EventEarlyNotification { get { return ResourceManager.GetString("EventEarlyNotification", resourceCulture); } } - + internal static string SettingsEventEarlyNotificationOffset { get { return ResourceManager.GetString("SettingsEventEarlyNotificationOffset", resourceCulture); } } - + internal static string UserNotFound { get { return ResourceManager.GetString("UserNotFound", resourceCulture); } } - + internal static string SettingsDefaultRole { get { return ResourceManager.GetString("SettingsDefaultRole", resourceCulture); } } - + internal static string SettingsPublicFeedbackChannel { get { return ResourceManager.GetString("SettingsPublicFeedbackChannel", resourceCulture); } } - + internal static string SettingsPrivateFeedbackChannel { get { return ResourceManager.GetString("SettingsPrivateFeedbackChannel", resourceCulture); } } - + internal static string SettingsReturnRolesOnRejoin { get { return ResourceManager.GetString("SettingsReturnRolesOnRejoin", resourceCulture); } } - + internal static string SettingsAutoStartEvents { get { return ResourceManager.GetString("SettingsAutoStartEvents", resourceCulture); } } - + internal static string IssuedBy { get { return ResourceManager.GetString("IssuedBy", resourceCulture); } } - + internal static string EventCreatedTitle { get { return ResourceManager.GetString("EventCreatedTitle", resourceCulture); } } - + internal static string DescriptionLocalEventCreated { get { return ResourceManager.GetString("DescriptionLocalEventCreated", resourceCulture); } } - + internal static string DescriptionExternalEventCreated { get { return ResourceManager.GetString("DescriptionExternalEventCreated", resourceCulture); } } - + internal static string ButtonOpenEventInfo { get { return ResourceManager.GetString("ButtonOpenEventInfo", resourceCulture); } } - + internal static string EventDuration { get { return ResourceManager.GetString("EventDuration", resourceCulture); } } - + internal static string DescriptionLocalEventStarted { get { return ResourceManager.GetString("DescriptionLocalEventStarted", resourceCulture); } } - + internal static string DescriptionExternalEventStarted { get { return ResourceManager.GetString("DescriptionExternalEventStarted", resourceCulture); } } - + internal static string UserAlreadyBanned { get { return ResourceManager.GetString("UserAlreadyBanned", resourceCulture); } } - + internal static string UserUnbanned { get { return ResourceManager.GetString("UserUnbanned", resourceCulture); } } - + internal static string UserMuted { get { return ResourceManager.GetString("UserMuted", resourceCulture); } } - + internal static string UserUnmuted { get { return ResourceManager.GetString("UserUnmuted", resourceCulture); } } - + internal static string UserNotMuted { get { return ResourceManager.GetString("UserNotMuted", resourceCulture); } } - + internal static string UserNotFoundShort { get { return ResourceManager.GetString("UserNotFoundShort", resourceCulture); } } - + internal static string UserKicked { get { return ResourceManager.GetString("UserKicked", resourceCulture); } } - + internal static string DescriptionActionReason { get { return ResourceManager.GetString("DescriptionActionReason", resourceCulture); } } - + internal static string DescriptionActionExpiresAt { get { return ResourceManager.GetString("DescriptionActionExpiresAt", resourceCulture); } } - + internal static string UserAlreadyMuted { get { return ResourceManager.GetString("UserAlreadyMuted", resourceCulture); } } - + internal static string MessageFrom { get { return ResourceManager.GetString("MessageFrom", resourceCulture); } } - + internal static string AboutTitleDevelopers { get { return ResourceManager.GetString("AboutTitleDevelopers", resourceCulture); } } - + internal static string ButtonOpenRepository { get { return ResourceManager.GetString("ButtonOpenRepository", resourceCulture); } } - + internal static string AboutBot { get { return ResourceManager.GetString("AboutBot", resourceCulture); } } - + internal static string AboutDeveloper_mctaylors { get { return ResourceManager.GetString("AboutDeveloper@mctaylors", resourceCulture); } } - + internal static string AboutDeveloper_Octol1ttle { get { return ResourceManager.GetString("AboutDeveloper@Octol1ttle", resourceCulture); } } - + internal static string AboutDeveloper_neroduckale { get { return ResourceManager.GetString("AboutDeveloper@neroduckale", resourceCulture); } } - + internal static string ReminderCreated { get { return ResourceManager.GetString("ReminderCreated", resourceCulture); } } - + internal static string Reminder { get { return ResourceManager.GetString("Reminder", resourceCulture); } } - + internal static string DescriptionReminder { get { return ResourceManager.GetString("DescriptionReminder", resourceCulture); } } - + internal static string SettingsListTitle { get { return ResourceManager.GetString("SettingsListTitle", resourceCulture); } } - + internal static string SettingSuccessfullyChanged { get { return ResourceManager.GetString("SettingSuccessfullyChanged", resourceCulture); } } - + internal static string SettingNotChanged { get { return ResourceManager.GetString("SettingNotChanged", resourceCulture); } } - + internal static string SettingIsNow { get { return ResourceManager.GetString("SettingIsNow", resourceCulture); } } - + + internal static string SettingsRenameHoistedUsers { + get { + return ResourceManager.GetString("SettingsRenameHoistedUsers", resourceCulture); + } + } + internal static string Page { get { return ResourceManager.GetString("Page", resourceCulture); } } - + internal static string PageNotFound { get { return ResourceManager.GetString("PageNotFound", resourceCulture); } } - + internal static string PagesAllowed { get { return ResourceManager.GetString("PagesAllowed", resourceCulture); } } - + internal static string Next { get { return ResourceManager.GetString("Next", resourceCulture); } } - + internal static string Previous { get { return ResourceManager.GetString("Previous", resourceCulture); } } - + internal static string ReminderList { get { return ResourceManager.GetString("ReminderList", resourceCulture); } } - + internal static string InvalidReminderPosition { get { return ResourceManager.GetString("InvalidReminderPosition", resourceCulture); } } - + internal static string ReminderDeleted { get { return ResourceManager.GetString("ReminderDeleted", resourceCulture); } } - + internal static string NoRemindersFound { get { return ResourceManager.GetString("NoRemindersFound", resourceCulture); } } - + internal static string SingleSettingReset { get { return ResourceManager.GetString("SingleSettingReset", resourceCulture); } } - + internal static string AllSettingsReset { get { return ResourceManager.GetString("AllSettingsReset", resourceCulture); } } - + internal static string DescriptionActionJumpToMessage { get { return ResourceManager.GetString("DescriptionActionJumpToMessage", resourceCulture); } } - + internal static string DescriptionActionJumpToChannel { get { return ResourceManager.GetString("DescriptionActionJumpToChannel", resourceCulture); } } - + internal static string ReminderPosition { get { return ResourceManager.GetString("ReminderPosition", resourceCulture); } } - + internal static string ReminderTime { get { return ResourceManager.GetString("ReminderTime", resourceCulture); } } - + internal static string ReminderText { get { return ResourceManager.GetString("ReminderText", resourceCulture); } } - - internal static string InformationAbout { - get { - return ResourceManager.GetString("InformationAbout", resourceCulture); - } - } - + internal static string UserInfoDisplayName { get { return ResourceManager.GetString("UserInfoDisplayName", resourceCulture); } } - - internal static string UserInfoDiscordUserSince { + + internal static string InformationAbout { get { - return ResourceManager.GetString("UserInfoDiscordUserSince", resourceCulture); + return ResourceManager.GetString("InformationAbout", resourceCulture); } } - + internal static string UserInfoMuted { get { return ResourceManager.GetString("UserInfoMuted", resourceCulture); } } - + + internal static string UserInfoDiscordUserSince { + get { + return ResourceManager.GetString("UserInfoDiscordUserSince", resourceCulture); + } + } + internal static string UserInfoBanned { get { return ResourceManager.GetString("UserInfoBanned", resourceCulture); } } - + internal static string UserInfoPunishments { get { return ResourceManager.GetString("UserInfoPunishments", resourceCulture); } } - + internal static string UserInfoBannedPermanently { get { return ResourceManager.GetString("UserInfoBannedPermanently", resourceCulture); } } - + internal static string UserInfoNotOnGuild { get { return ResourceManager.GetString("UserInfoNotOnGuild", resourceCulture); } } - + internal static string UserInfoMutedByTimeout { get { return ResourceManager.GetString("UserInfoMutedByTimeout", resourceCulture); } } - + internal static string UserInfoMutedByMuteRole { get { return ResourceManager.GetString("UserInfoMutedByMuteRole", resourceCulture); } } - + internal static string UserInfoGuildMemberSince { get { return ResourceManager.GetString("UserInfoGuildMemberSince", resourceCulture); } } - + internal static string UserInfoGuildNickname { get { return ResourceManager.GetString("UserInfoGuildNickname", resourceCulture); } } - + internal static string UserInfoGuildRoles { get { return ResourceManager.GetString("UserInfoGuildRoles", resourceCulture); } } - + internal static string UserInfoGuildMemberPremiumSince { get { return ResourceManager.GetString("UserInfoGuildMemberPremiumSince", resourceCulture); } } - - internal static string RandomTitle - { + + internal static string RandomTitle { get { return ResourceManager.GetString("RandomTitle", resourceCulture); } } - - internal static string RandomMinMaxSame - { + + internal static string RandomMinMaxSame { get { return ResourceManager.GetString("RandomMinMaxSame", resourceCulture); } } - - internal static string RandomMax - { - get { - return ResourceManager.GetString("RandomMax", resourceCulture); - } - } - - internal static string RandomMin - { + + internal static string RandomMin { get { return ResourceManager.GetString("RandomMin", resourceCulture); } } - - internal static string Default - { + + internal static string RandomMax { + get { + return ResourceManager.GetString("RandomMax", resourceCulture); + } + } + + internal static string Default { get { return ResourceManager.GetString("Default", resourceCulture); } } - - internal static string TimestampTitle - { - get - { + + internal static string TimestampTitle { + get { return ResourceManager.GetString("TimestampTitle", resourceCulture); } } - - internal static string TimestampOffset - { - get - { + + internal static string TimestampOffset { + get { return ResourceManager.GetString("TimestampOffset", resourceCulture); } } - - internal static string GuildInfoDescription - { - get - { + + internal static string GuildInfoDescription { + get { return ResourceManager.GetString("GuildInfoDescription", resourceCulture); } } - - internal static string GuildInfoCreatedAt - { - get - { + + internal static string GuildInfoCreatedAt { + get { return ResourceManager.GetString("GuildInfoCreatedAt", resourceCulture); } } - - internal static string GuildInfoOwner - { - get - { + + internal static string GuildInfoOwner { + get { return ResourceManager.GetString("GuildInfoOwner", resourceCulture); } } - - internal static string GuildInfoServerBoost - { - get - { + + internal static string GuildInfoServerBoost { + get { return ResourceManager.GetString("GuildInfoServerBoost", resourceCulture); } } - - internal static string GuildInfoBoostTier - { - get - { + + internal static string GuildInfoBoostTier { + get { return ResourceManager.GetString("GuildInfoBoostTier", resourceCulture); } } - - internal static string GuildInfoBoostCount - { - get - { + + internal static string GuildInfoBoostCount { + get { return ResourceManager.GetString("GuildInfoBoostCount", resourceCulture); } } - - internal static string NoMessagesToClear - { - get - { + + internal static string NoMessagesToClear { + get { return ResourceManager.GetString("NoMessagesToClear", resourceCulture); } } - - internal static string MessagesClearedFiltered - { - get - { + + internal static string MessagesClearedFiltered { + get { return ResourceManager.GetString("MessagesClearedFiltered", resourceCulture); } } - - internal static string DataLoadFailedTitle - { - get - { + + internal static string DataLoadFailedTitle { + get { return ResourceManager.GetString("DataLoadFailedTitle", resourceCulture); } } - - internal static string DataLoadFailedDescription - { - get - { + + internal static string DataLoadFailedDescription { + get { return ResourceManager.GetString("DataLoadFailedDescription", resourceCulture); } } - - internal static string CommandExecutionFailed - { - get - { + + internal static string CommandExecutionFailed { + get { return ResourceManager.GetString("CommandExecutionFailed", resourceCulture); } } - - internal static string ContactDevelopers - { - get - { + + internal static string ContactDevelopers { + get { return ResourceManager.GetString("ContactDevelopers", resourceCulture); } } - - internal static string ButtonReportIssue - { - get - { + + internal static string ButtonReportIssue { + get { return ResourceManager.GetString("ButtonReportIssue", resourceCulture); } } - + internal static string DefaultLeaveMessage { get { return ResourceManager.GetString("DefaultLeaveMessage", resourceCulture); } } - + internal static string SettingsLeaveMessage { get { return ResourceManager.GetString("SettingsLeaveMessage", resourceCulture); } } - + internal static string InvalidTimeSpan { get { return ResourceManager.GetString("InvalidTimeSpan", resourceCulture); } } - + internal static string UserInfoKicked { get { return ResourceManager.GetString("UserInfoKicked", resourceCulture); } } - + internal static string ReminderEdited { get { return ResourceManager.GetString("ReminderEdited", resourceCulture); } } - + internal static string EightBallPositive1 { get { return ResourceManager.GetString("EightBallPositive1", resourceCulture); } } - + internal static string EightBallPositive2 { get { return ResourceManager.GetString("EightBallPositive2", resourceCulture); } } - + internal static string EightBallPositive3 { get { return ResourceManager.GetString("EightBallPositive3", resourceCulture); } } - + internal static string EightBallPositive4 { get { return ResourceManager.GetString("EightBallPositive4", resourceCulture); } } - + internal static string EightBallPositive5 { get { return ResourceManager.GetString("EightBallPositive5", resourceCulture); } } - + internal static string EightBallQuestionable1 { get { return ResourceManager.GetString("EightBallQuestionable1", resourceCulture); } } - + internal static string EightBallQuestionable2 { get { return ResourceManager.GetString("EightBallQuestionable2", resourceCulture); } } - + internal static string EightBallQuestionable3 { get { return ResourceManager.GetString("EightBallQuestionable3", resourceCulture); } } - + internal static string EightBallQuestionable4 { get { return ResourceManager.GetString("EightBallQuestionable4", resourceCulture); } } - + internal static string EightBallQuestionable5 { get { return ResourceManager.GetString("EightBallQuestionable5", resourceCulture); } } - + internal static string EightBallNeutral1 { get { return ResourceManager.GetString("EightBallNeutral1", resourceCulture); } } - + internal static string EightBallNeutral2 { get { return ResourceManager.GetString("EightBallNeutral2", resourceCulture); } } - + internal static string EightBallNeutral3 { get { return ResourceManager.GetString("EightBallNeutral3", resourceCulture); } } - + internal static string EightBallNeutral4 { get { return ResourceManager.GetString("EightBallNeutral4", resourceCulture); } } - + internal static string EightBallNeutral5 { get { return ResourceManager.GetString("EightBallNeutral5", resourceCulture); } } - + internal static string EightBallNegative1 { get { return ResourceManager.GetString("EightBallNegative1", resourceCulture); } } - + internal static string EightBallNegative2 { get { return ResourceManager.GetString("EightBallNegative2", resourceCulture); } } - + internal static string EightBallNegative3 { get { return ResourceManager.GetString("EightBallNegative3", resourceCulture); } } - + internal static string EightBallNegative4 { get { return ResourceManager.GetString("EightBallNegative4", resourceCulture); } } - + internal static string EightBallNegative5 { get { return ResourceManager.GetString("EightBallNegative5", resourceCulture); } } - + internal static string TimeSpanExample { get { return ResourceManager.GetString("TimeSpanExample", resourceCulture); } } - + internal static string Version { get { return ResourceManager.GetString("Version", resourceCulture); } } - + internal static string SettingsWelcomeMessagesChannel { get { return ResourceManager.GetString("SettingsWelcomeMessagesChannel", resourceCulture); } } - + internal static string ButtonDirty { get { return ResourceManager.GetString("ButtonDirty", resourceCulture); } } - + internal static string ButtonOpenWiki { get { return ResourceManager.GetString("ButtonOpenWiki", resourceCulture); } } + + internal static string SettingsModeratorRole { + get { + return ResourceManager.GetString("SettingsModeratorRole", resourceCulture); + } + } } } diff --git a/locale/Messages.resx b/TeamOctolings.Octobot/Messages.resx similarity index 100% rename from locale/Messages.resx rename to TeamOctolings.Octobot/Messages.resx diff --git a/locale/Messages.ru.resx b/TeamOctolings.Octobot/Messages.ru.resx similarity index 100% rename from locale/Messages.ru.resx rename to TeamOctolings.Octobot/Messages.ru.resx diff --git a/src/Parsers/TimeSpanParser.cs b/TeamOctolings.Octobot/Parsers/TimeSpanParser.cs similarity index 98% rename from src/Parsers/TimeSpanParser.cs rename to TeamOctolings.Octobot/Parsers/TimeSpanParser.cs index 1f44d46..99a8b90 100644 --- a/src/Parsers/TimeSpanParser.cs +++ b/TeamOctolings.Octobot/Parsers/TimeSpanParser.cs @@ -4,7 +4,7 @@ using JetBrains.Annotations; using Remora.Commands.Parsers; using Remora.Results; -namespace Octobot.Parsers; +namespace TeamOctolings.Octobot.Parsers; /// /// Parses s. diff --git a/src/Octobot.cs b/TeamOctolings.Octobot/Program.cs similarity index 86% rename from src/Octobot.cs rename to TeamOctolings.Octobot/Program.cs index 065967e..d1d6220 100644 --- a/src/Octobot.cs +++ b/TeamOctolings.Octobot/Program.cs @@ -2,13 +2,8 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Octobot.Attributes; -using Octobot.Commands.Events; -using Octobot.Services; -using Octobot.Services.Update; using Remora.Discord.API.Abstractions.Gateway.Commands; using Remora.Discord.API.Abstractions.Objects; -using Remora.Discord.API.Objects; using Remora.Discord.Caching.Extensions; using Remora.Discord.Caching.Services; using Remora.Discord.Commands.Extensions; @@ -16,24 +11,20 @@ using Remora.Discord.Commands.Services; using Remora.Discord.Extensions.Extensions; using Remora.Discord.Gateway; using Remora.Discord.Hosting.Extensions; -using Remora.Rest.Core; using Serilog.Extensions.Logging; +using TeamOctolings.Octobot.Commands.Events; +using TeamOctolings.Octobot.Services; +using TeamOctolings.Octobot.Services.Update; -namespace Octobot; +namespace TeamOctolings.Octobot; -public sealed class Octobot +public sealed class Program { - public static readonly AllowedMentions NoMentions = new( - Array.Empty(), Array.Empty(), Array.Empty()); - - [StaticCallersOnly] - public static ILogger? StaticLogger { get; private set; } - public static async Task Main(string[] args) { var host = CreateHostBuilder(args).UseConsoleLifetime().Build(); var services = host.Services; - StaticLogger = services.GetRequiredService>(); + Utility.StaticLogger = services.GetRequiredService>(); var slashService = services.GetRequiredService(); // Providing a guild ID to this call will result in command duplicates! @@ -82,8 +73,8 @@ public sealed class Octobot // Init .AddDiscordCaching() .AddDiscordCommands(true, false) - .AddRespondersFromAssembly(typeof(Octobot).Assembly) - .AddCommandGroupsFromAssembly(typeof(Octobot).Assembly) + .AddRespondersFromAssembly(typeof(Program).Assembly) + .AddCommandGroupsFromAssembly(typeof(Program).Assembly) // Slash command event handlers .AddPreparationErrorEvent() .AddPostExecutionEvent() diff --git a/src/Responders/GuildLoadedResponder.cs b/TeamOctolings.Octobot/Responders/GuildLoadedResponder.cs similarity index 96% rename from src/Responders/GuildLoadedResponder.cs rename to TeamOctolings.Octobot/Responders/GuildLoadedResponder.cs index 55e9673..0c71a06 100644 --- a/src/Responders/GuildLoadedResponder.cs +++ b/TeamOctolings.Octobot/Responders/GuildLoadedResponder.cs @@ -1,8 +1,5 @@ using JetBrains.Annotations; using Microsoft.Extensions.Logging; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; @@ -11,8 +8,11 @@ using Remora.Discord.API.Objects; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Gateway.Responders; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles sending a message to a guild that has just initialized if that guild diff --git a/src/Responders/GuildMemberJoinedResponder.cs b/TeamOctolings.Octobot/Responders/GuildMemberJoinedResponder.cs similarity index 94% rename from src/Responders/GuildMemberJoinedResponder.cs rename to TeamOctolings.Octobot/Responders/GuildMemberJoinedResponder.cs index 61ef5cc..6964fe7 100644 --- a/src/Responders/GuildMemberJoinedResponder.cs +++ b/TeamOctolings.Octobot/Responders/GuildMemberJoinedResponder.cs @@ -1,16 +1,16 @@ using System.Text.Json.Nodes; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Rest; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Gateway.Responders; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles sending a guild's if one is set. @@ -77,7 +77,7 @@ public class GuildMemberJoinedResponder : IResponder return await _channelApi.CreateMessageWithEmbedResultAsync( GuildSettings.WelcomeMessagesChannel.Get(cfg), embedResult: embed, - allowedMentions: Octobot.NoMentions, ct: ct); + allowedMentions: Utility.NoMentions, ct: ct); } private async Task TryReturnRolesAsync( diff --git a/src/Responders/GuildMemberLeftResponder.cs b/TeamOctolings.Octobot/Responders/GuildMemberLeftResponder.cs similarity index 91% rename from src/Responders/GuildMemberLeftResponder.cs rename to TeamOctolings.Octobot/Responders/GuildMemberLeftResponder.cs index 90cc64c..4f6150c 100644 --- a/src/Responders/GuildMemberLeftResponder.cs +++ b/TeamOctolings.Octobot/Responders/GuildMemberLeftResponder.cs @@ -1,14 +1,14 @@ using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Rest; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Gateway.Responders; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles sending a guild's if one is set. @@ -67,6 +67,6 @@ public class GuildMemberLeftResponder : IResponder return await _channelApi.CreateMessageWithEmbedResultAsync( GuildSettings.WelcomeMessagesChannel.Get(cfg), embedResult: embed, - allowedMentions: Octobot.NoMentions, ct: ct); + allowedMentions: Utility.NoMentions, ct: ct); } } diff --git a/src/Responders/GuildUnloadedResponder.cs b/TeamOctolings.Octobot/Responders/GuildUnloadedResponder.cs similarity index 90% rename from src/Responders/GuildUnloadedResponder.cs rename to TeamOctolings.Octobot/Responders/GuildUnloadedResponder.cs index b49d136..a4680d4 100644 --- a/src/Responders/GuildUnloadedResponder.cs +++ b/TeamOctolings.Octobot/Responders/GuildUnloadedResponder.cs @@ -1,12 +1,12 @@ using JetBrains.Annotations; using Microsoft.Extensions.Logging; -using Octobot.Data; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.Gateway.Responders; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles removing guild ID from if the guild becomes unavailable. diff --git a/src/Responders/MessageDeletedResponder.cs b/TeamOctolings.Octobot/Responders/MessageDeletedResponder.cs similarity index 94% rename from src/Responders/MessageDeletedResponder.cs rename to TeamOctolings.Octobot/Responders/MessageDeletedResponder.cs index 5a69273..6b09b8d 100644 --- a/src/Responders/MessageDeletedResponder.cs +++ b/TeamOctolings.Octobot/Responders/MessageDeletedResponder.cs @@ -1,8 +1,5 @@ using System.Text; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; @@ -10,8 +7,11 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Discord.Gateway.Responders; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles logging the contents of a deleted message and the user who deleted the message @@ -102,6 +102,6 @@ public class MessageDeletedResponder : IResponder return await _channelApi.CreateMessageWithEmbedResultAsync( GuildSettings.PrivateFeedbackChannel.Get(cfg), embedResult: embed, - allowedMentions: Octobot.NoMentions, ct: ct); + allowedMentions: Utility.NoMentions, ct: ct); } } diff --git a/src/Responders/MessageEditedResponder.cs b/TeamOctolings.Octobot/Responders/MessageEditedResponder.cs similarity index 95% rename from src/Responders/MessageEditedResponder.cs rename to TeamOctolings.Octobot/Responders/MessageEditedResponder.cs index 1143652..6134214 100644 --- a/src/Responders/MessageEditedResponder.cs +++ b/TeamOctolings.Octobot/Responders/MessageEditedResponder.cs @@ -1,9 +1,6 @@ using System.Text; using DiffPlex.DiffBuilder; using JetBrains.Annotations; -using Octobot.Data; -using Octobot.Extensions; -using Octobot.Services; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; @@ -12,8 +9,11 @@ using Remora.Discord.Caching.Services; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Gateway.Responders; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; +using TeamOctolings.Octobot.Services; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles logging the difference between an edited message's old and new content @@ -104,6 +104,6 @@ public class MessageEditedResponder : IResponder return await _channelApi.CreateMessageWithEmbedResultAsync( GuildSettings.PrivateFeedbackChannel.Get(cfg), embedResult: embed, - allowedMentions: Octobot.NoMentions, ct: ct); + allowedMentions: Utility.NoMentions, ct: ct); } } diff --git a/src/Responders/MessageReceivedResponder.cs b/TeamOctolings.Octobot/Responders/MessageReceivedResponder.cs similarity index 96% rename from src/Responders/MessageReceivedResponder.cs rename to TeamOctolings.Octobot/Responders/MessageReceivedResponder.cs index 4c26d8d..34a8f5c 100644 --- a/src/Responders/MessageReceivedResponder.cs +++ b/TeamOctolings.Octobot/Responders/MessageReceivedResponder.cs @@ -5,7 +5,7 @@ using Remora.Discord.Gateway.Responders; using Remora.Rest.Core; using Remora.Results; -namespace Octobot.Responders; +namespace TeamOctolings.Octobot.Responders; /// /// Handles sending replies to easter egg messages. diff --git a/src/Services/AccessControlService.cs b/TeamOctolings.Octobot/Services/AccessControlService.cs similarity index 97% rename from src/Services/AccessControlService.cs rename to TeamOctolings.Octobot/Services/AccessControlService.cs index cb235f9..b5b98ea 100644 --- a/src/Services/AccessControlService.cs +++ b/TeamOctolings.Octobot/Services/AccessControlService.cs @@ -1,11 +1,11 @@ -using Octobot.Data; -using Octobot.Extensions; -using Remora.Discord.API.Abstractions.Objects; +using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Services; +namespace TeamOctolings.Octobot.Services; public sealed class AccessControlService { diff --git a/src/Services/GuildDataService.cs b/TeamOctolings.Octobot/Services/GuildDataService.cs similarity index 98% rename from src/Services/GuildDataService.cs rename to TeamOctolings.Octobot/Services/GuildDataService.cs index e503d22..866ee08 100644 --- a/src/Services/GuildDataService.cs +++ b/TeamOctolings.Octobot/Services/GuildDataService.cs @@ -3,10 +3,10 @@ using System.Text.Json; using System.Text.Json.Nodes; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Octobot.Data; using Remora.Rest.Core; +using TeamOctolings.Octobot.Data; -namespace Octobot.Services; +namespace TeamOctolings.Octobot.Services; /// /// Handles saving, loading, initializing and providing . diff --git a/src/Services/Update/MemberUpdateService.cs b/TeamOctolings.Octobot/Services/Update/MemberUpdateService.cs similarity index 98% rename from src/Services/Update/MemberUpdateService.cs rename to TeamOctolings.Octobot/Services/Update/MemberUpdateService.cs index e177fca..51cf647 100644 --- a/src/Services/Update/MemberUpdateService.cs +++ b/TeamOctolings.Octobot/Services/Update/MemberUpdateService.cs @@ -2,16 +2,16 @@ using System.Text; using System.Text.RegularExpressions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Octobot.Data; -using Octobot.Extensions; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Services.Update; +namespace TeamOctolings.Octobot.Services.Update; public sealed partial class MemberUpdateService : BackgroundService { diff --git a/src/Services/Update/ScheduledEventUpdateService.cs b/TeamOctolings.Octobot/Services/Update/ScheduledEventUpdateService.cs similarity index 99% rename from src/Services/Update/ScheduledEventUpdateService.cs rename to TeamOctolings.Octobot/Services/Update/ScheduledEventUpdateService.cs index cb87779..ce9c212 100644 --- a/src/Services/Update/ScheduledEventUpdateService.cs +++ b/TeamOctolings.Octobot/Services/Update/ScheduledEventUpdateService.cs @@ -1,8 +1,6 @@ using System.Text.Json.Nodes; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Octobot.Data; -using Octobot.Extensions; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; using Remora.Discord.API.Objects; @@ -10,8 +8,10 @@ using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Services.Update; +namespace TeamOctolings.Octobot.Services.Update; public sealed class ScheduledEventUpdateService : BackgroundService { diff --git a/src/Services/Update/SongUpdateService.cs b/TeamOctolings.Octobot/Services/Update/SongUpdateService.cs similarity index 98% rename from src/Services/Update/SongUpdateService.cs rename to TeamOctolings.Octobot/Services/Update/SongUpdateService.cs index 41d5bf3..b07256f 100644 --- a/src/Services/Update/SongUpdateService.cs +++ b/TeamOctolings.Octobot/Services/Update/SongUpdateService.cs @@ -4,7 +4,7 @@ using Remora.Discord.API.Gateway.Commands; using Remora.Discord.API.Objects; using Remora.Discord.Gateway; -namespace Octobot.Services.Update; +namespace TeamOctolings.Octobot.Services.Update; public sealed class SongUpdateService : BackgroundService { diff --git a/Octobot.csproj b/TeamOctolings.Octobot/TeamOctolings.Octobot.csproj similarity index 90% rename from Octobot.csproj rename to TeamOctolings.Octobot/TeamOctolings.Octobot.csproj index bdfb46a..9c3d58b 100644 --- a/Octobot.csproj +++ b/TeamOctolings.Octobot/TeamOctolings.Octobot.csproj @@ -1,4 +1,4 @@ - + Exe @@ -16,7 +16,7 @@ TeamOctolings en A general-purpose Discord bot for moderation written in C# - docs/octobot.ico + ../docs/octobot.ico false @@ -35,12 +35,12 @@ - + ResXFileCodeGenerator Messages.Designer.cs - + diff --git a/src/Services/Utility.cs b/TeamOctolings.Octobot/Utility.cs similarity index 92% rename from src/Services/Utility.cs rename to TeamOctolings.Octobot/Utility.cs index 3b9ab19..463212b 100644 --- a/src/Services/Utility.cs +++ b/TeamOctolings.Octobot/Utility.cs @@ -1,16 +1,19 @@ using System.Drawing; using System.Text; using System.Text.Json.Nodes; -using Octobot.Data; -using Octobot.Extensions; +using Microsoft.Extensions.Logging; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Abstractions.Rest; +using Remora.Discord.API.Objects; using Remora.Discord.Extensions.Embeds; using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; +using TeamOctolings.Octobot.Attributes; +using TeamOctolings.Octobot.Data; +using TeamOctolings.Octobot.Extensions; -namespace Octobot.Services; +namespace TeamOctolings.Octobot; /// /// Provides utility methods that cannot be transformed to extension methods because they require usage @@ -18,6 +21,9 @@ namespace Octobot.Services; /// public sealed class Utility { + public static readonly AllowedMentions NoMentions = new( + Array.Empty(), Array.Empty(), Array.Empty()); + private readonly IDiscordRestChannelAPI _channelApi; private readonly IDiscordRestGuildScheduledEventAPI _eventApi; private readonly IDiscordRestGuildAPI _guildApi; @@ -30,6 +36,9 @@ public sealed class Utility _guildApi = guildApi; } + [StaticCallersOnly] + public static ILogger? StaticLogger { get; set; } + /// /// Gets the string mentioning the and event subscribers related to /// a scheduled