This commit is contained in:
@@ -5,7 +5,6 @@ using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PluginManager
|
||||
{
|
||||
|
||||
@@ -246,6 +246,8 @@ public class ConsoleCommandsHandler
|
||||
await client.StopAsync();
|
||||
await client.DisposeAsync();
|
||||
Config.SaveConfig();
|
||||
Console.WriteLine("Bot is closing in 2 seconds ! Please wait to save data !");
|
||||
await Task.Delay(2000);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace PluginManager.Others
|
||||
/// <param name="LogMessage">The message to be wrote</param>
|
||||
public static void WriteLogFile(string LogMessage)
|
||||
{
|
||||
string logsPath = logFolder + "Log.txt";
|
||||
string logsPath = logFolder + $"{DateTime.Today.ToShortDateString().Replace("/", "-").Replace("\\", "-")} Log.txt";
|
||||
if (!Directory.Exists(logFolder)) Directory.CreateDirectory(logFolder);
|
||||
File.AppendAllText(logsPath, LogMessage + " \n");
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace PluginManager.Others
|
||||
/// <param name="ErrMessage">The message to be wrote</param>
|
||||
public static void WriteErrFile(string ErrMessage)
|
||||
{
|
||||
string errPath = errFolder + "Error.txt";
|
||||
string errPath = errFolder + $"{DateTime.Today.ToShortDateString().Replace("/", "-").Replace("\\", "-")} Error.txt";
|
||||
if (!Directory.Exists(errFolder)) Directory.CreateDirectory(errFolder);
|
||||
File.AppendAllText(errPath, ErrMessage + " \n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user