Skip to content

Commit

Permalink
[Bot -> Core] Reformat entry point again.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogFeelings committed Apr 13, 2024
1 parent b6ecafb commit ef03ee0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
11 changes: 11 additions & 0 deletions SammBot.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_LINQ_QUERY/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARGUMENT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_PATTERNS/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXPRESSION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_PARAMETER/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_CONSTRAINS/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_LIST/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_TUPLE_COMPONENTS/@EntryValue">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_INSIDE_REGION/@EntryValue">0</s:Int64>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">License Information (GPLv3)</s:String>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">Samm-Bot - A lightweight Discord.NET bot for moderation and other purposes.
Expand Down
34 changes: 17 additions & 17 deletions Source/SammBot.Bot/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private async Task MainAsync()
}

Console.WriteLine("Initializing logger...");

InitializeLogger();

#if DEBUG
Expand All @@ -96,29 +96,29 @@ private async Task MainAsync()

DiscordSocketConfig socketConfig = new DiscordSocketConfig()
{
LogLevel = Discord.LogSeverity.Warning,
MessageCacheSize = SettingsManager.Instance.LoadedConfig.MessageCacheSize,
AlwaysDownloadUsers = true,
GatewayIntents = GatewayIntents.All,
LogGatewayIntentWarnings = false
LogLevel = Discord.LogSeverity.Warning,
MessageCacheSize = SettingsManager.Instance.LoadedConfig.MessageCacheSize,
AlwaysDownloadUsers = true,
GatewayIntents = GatewayIntents.All,
LogGatewayIntentWarnings = false
};
InteractionServiceConfig interactionConfig = new InteractionServiceConfig()
{
LogLevel = Discord.LogSeverity.Info,
DefaultRunMode = RunMode.Async,
LogLevel = Discord.LogSeverity.Info,
DefaultRunMode = RunMode.Async,
};

_shardedClient = new DiscordShardedClient(socketConfig);
_interactionService = new InteractionService(_shardedClient, interactionConfig);

await _matchaLogger.LogAsync(LogSeverity.Success, "Created Discord client successfully.");
await _matchaLogger.LogAsync(LogSeverity.Information, "Configuring service provider...");

ServiceProvider serviceProvider = ConfigureServiceProvider();

await _matchaLogger.LogAsync(LogSeverity.Success, "Configured service provider successfully.");
await _matchaLogger.LogAsync(LogSeverity.Information, "Starting the startup service...");

await serviceProvider.GetRequiredService<StartupService>().StartAsync();

// Never exit unless a critical exception occurs.
Expand Down Expand Up @@ -153,30 +153,30 @@ private ServiceProvider ConfigureServiceProvider()
private void InitializeLogger()
{
LogSeverity filterLevel;

#if DEBUG
filterLevel = LogSeverity.Debug;
#else
filterLevel = LogSeverity.Information;
#endif

ConsoleSinkConfig consoleConfig = new ConsoleSinkConfig()
{
SeverityFilterLevel = filterLevel
SeverityFilterLevel = filterLevel
};
FileSinkConfig fileConfig = new FileSinkConfig()
{
SeverityFilterLevel = filterLevel,
FilePath = Path.Combine(SettingsManager.Instance.BotDataDirectory, "Logs")
SeverityFilterLevel = filterLevel,
FilePath = Path.Combine(SettingsManager.Instance.BotDataDirectory, "Logs")
};

ConsoleSink consoleSink = new ConsoleSink()
{
Config = consoleConfig
Config = consoleConfig
};
FileSink fileSink = new FileSink()
{
Config = fileConfig
Config = fileConfig
};

_matchaLogger = new MatchaLogger(consoleSink, fileSink);
Expand Down

0 comments on commit ef03ee0

Please sign in to comment.