Skip to content

Commit

Permalink
[All -> General] Some minor cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogFeelings committed Feb 8, 2024
1 parent eadb273 commit 2e95276
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Source/SammBot.Bot/Database/BotDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using SammBot.Bot.Core;
using System.IO;
using JetBrains.Annotations;
using SammBot.Library.Database.Models;
using SammBot.Bot.Settings;
using SammBot.Library.Models.Database;

namespace SammBot.Bot.Database;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@
using System.Threading.Tasks;
using Discord.Interactions;
using Fergun.Interactive;
using SammBot.Bot.Logging;
using SammBot.Bot.Services;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Helpers;
using System.Text.Json;

namespace SammBot.Bot.Core;
namespace SammBot.Bot;

/// <summary>
/// A class containing all of the startup logic.
/// </summary>
public class MainProgram
public class EntryPoint
{
private DiscordShardedClient _ShardedClient = default!;
private InteractionService _InteractionService = default!;
Expand All @@ -48,9 +50,9 @@ public static void Main()
{
Constants.RuntimeStopwatch.Start();

MainProgram mainProgram = new MainProgram();
EntryPoint entryPoint = new EntryPoint();

AsyncHelper.RunSync(() => mainProgram.MainAsync());
AsyncHelper.RunSync(() => entryPoint.MainAsync());
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using System;
using System.Drawing;

namespace SammBot.Bot.Core;
namespace SammBot.Bot.Logging;

/// <summary>
/// Simple logger for the pre-StartupService state of the bot for when Matcha isn't available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
#endregion

using Discord;
using Discord.Interactions;
using Discord.WebSocket;
using Matcha;
using SammBot.Bot.Settings;
using System;
using System.IO;
using System.Threading.Tasks;
using Discord.Interactions;

namespace SammBot.Bot.Core;
namespace SammBot.Bot.Logging;

public class Logger
{
Expand Down
2 changes: 1 addition & 1 deletion Source/SammBot.Bot/Modules/BooruModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
using Fergun.Interactive;
using Fergun.Interactive.Pagination;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Services;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;
using SammBot.Library.Rest.E621;
using SammBot.Library.Rest.Rule34;
Expand Down
4 changes: 3 additions & 1 deletion Source/SammBot.Bot/Modules/BotAdminModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Logging;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
3 changes: 2 additions & 1 deletion Source/SammBot.Bot/Modules/FunModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Services;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;
using SammBot.Library.Rest.UrbanDictionary;

Expand Down
4 changes: 2 additions & 2 deletions Source/SammBot.Bot/Modules/GuildConfigModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
using Discord;
using Discord.Interactions;
using Microsoft.EntityFrameworkCore;
using SammBot.Bot.Core;
using SammBot.Bot.Database;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Database.Models;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Models.Database;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
2 changes: 1 addition & 1 deletion Source/SammBot.Bot/Modules/HelpModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
3 changes: 2 additions & 1 deletion Source/SammBot.Bot/Modules/InformationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
4 changes: 2 additions & 2 deletions Source/SammBot.Bot/Modules/ModerationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
using System.Linq;
using System.Threading.Tasks;
using Discord.Interactions;
using SammBot.Bot.Core;
using SammBot.Bot.Database;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Database.Models;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Models.Database;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
2 changes: 1 addition & 1 deletion Source/SammBot.Bot/Modules/RandomModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Services;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;
using SammBot.Library.Rest;

Expand Down
5 changes: 3 additions & 2 deletions Source/SammBot.Bot/Modules/UserTagsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
using System.Linq;
using System.Threading.Tasks;
using Discord.Interactions;
using SammBot.Bot.Core;
using SammBot.Bot.Database;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Database.Models;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Models.Database;
using SammBot.Library.Preconditions;

namespace SammBot.Bot.Modules;
Expand Down
3 changes: 2 additions & 1 deletion Source/SammBot.Bot/Modules/UtilsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
using System.Threading.Tasks;
using Discord.Interactions;
using JetBrains.Annotations;
using SammBot.Bot.Core;
using SammBot.Bot.Services;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Attributes;
using SammBot.Library.Extensions;
using SammBot.Library.Models;
using SammBot.Library.Preconditions;
using SammBot.Library.Rest.OpenWeather.Forecast;
using SammBot.Library.Rest.OpenWeather.Geolocation;
Expand Down
3 changes: 3 additions & 0 deletions Source/SammBot.Bot/SammBot.Bot.csproj.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=core_005Csettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=database_005Cdatabasedefinitions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=database_005Cmodels/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=loggers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=logging/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=settings/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=source/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=source_005Cclasses_005Cclassextensions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=source_005Cclasses_005Cextensions/@EntryIndexedValue">True</s:Boolean>
Expand Down
3 changes: 2 additions & 1 deletion Source/SammBot.Bot/Services/CommandService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
using Discord.Interactions;
using Discord.WebSocket;
using Microsoft.Extensions.DependencyInjection;
using SammBot.Bot.Core;
using SammBot.Bot.Logging;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Extensions;
using System;
Expand Down
3 changes: 1 addition & 2 deletions Source/SammBot.Bot/Services/EventLoggingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
using SammBot.Bot.Core;
using SammBot.Bot.Database;
using SammBot.Library;
using SammBot.Library.Database.Models;
using SammBot.Library.Extensions;
using SammBot.Library.Models.Database;

namespace SammBot.Bot.Services;

Expand Down
2 changes: 1 addition & 1 deletion Source/SammBot.Bot/Services/HttpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

using SammBot.Bot.Settings;
using System;
using System.Collections.Specialized;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using SammBot.Bot.Core;
using SammBot.Library.Components;
using SammBot.Library.Extensions;
using SammBot.Library.Services;
Expand Down
2 changes: 1 addition & 1 deletion Source/SammBot.Bot/Services/RandomService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

using SammBot.Bot.Core;
using SammBot.Bot.Settings;
using SharpCat.Requester.Cat;
using SharpCat.Requester.Dog;

Expand Down
3 changes: 2 additions & 1 deletion Source/SammBot.Bot/Services/StartupService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.DependencyInjection;
using SammBot.Bot.Core;
using SammBot.Bot.Database;
using SammBot.Bot.Logging;
using SammBot.Bot.Settings;
using SammBot.Library;
using SammBot.Library.Components;
using SammBot.Library.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

using System.Collections.Generic;
using SammBot.Library.Attributes;
using System.Collections.Generic;

namespace SammBot.Bot.Core;
namespace SammBot.Bot.Settings;

public class BotConfig
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

namespace SammBot.Bot.Core;
namespace SammBot.Bot.Settings;

public class BotStatus
public record BotStatus
{
public string Content { get; set; }
public int Type { get; set; }
public string Content { get; init; }
public int Type { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using System.Reflection;
using System.Text.Json;

namespace SammBot.Bot.Core;
namespace SammBot.Bot.Settings;

public class SettingsManager
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SammBot.Library.Database;
namespace SammBot.Library.Models.Database;

public class DatabaseEntity
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using Microsoft.EntityFrameworkCore;
using SammBot.Library.Attributes;

namespace SammBot.Library.Database.Models;
namespace SammBot.Library.Models.Database;

public enum WarnLimitAction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

namespace SammBot.Library.Database.Models;
namespace SammBot.Library.Models.Database;

public class UserTag : DatabaseEntity
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#endregion

namespace SammBot.Library.Database.Models;
namespace SammBot.Library.Models.Database;

public class UserWarning : DatabaseEntity
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

using Discord.Interactions;

namespace SammBot.Library;
namespace SammBot.Library.Models;

/// <summary>
/// Represents the result of an interaction execution.
Expand Down

0 comments on commit 2e95276

Please sign in to comment.