private async Task SaveMessages(bool ForceSave = false)
{
Spark.DebugLog(ChatMessages.Count.ToString());
if (LogMessages || ForceSave && ChatMessages.Count >= 0)
{
string FilePath = MessageLogPath + @"\ChatLog " + DateTime.Now.Day + ";" + DateTime.Now.Month + ";" + DateTime.Now.Year + ".txt";
if (!System.IO.File.Exists(FilePath))
{
System.IO.File.Create(FilePath);
}
await using (StreamWriter sw = new StreamWriter(FilePath))
{
foreach (string Message in ChatMessages)
{
sw.WriteLine(Message);
}
sw.Flush();
}
}
}
private async Task SaveMessages(bool ForceSave = false)
{
Spark.DebugLog(ChatMessages.Count.ToString());
if (LogMessages || ForceSave && ChatMessages.Count >= 0)
{
string FilePath = MessageLogPath + @"\ChatLog " + DateTime.Now.Day + ";" + DateTime.Now.Month + ";" + DateTime.Now.Year + ".txt";
if (!System.IO.File.Exists(FilePath))
{
System.IO.File.Create(FilePath);
}
await using (StreamWriter sw = new StreamWriter(FilePath))
{
foreach (string Message in ChatMessages)
{
sw.WriteLine(Message);
}
sw.Flush();
}
}
}