Updated to allow mention as command prefix. Updated DBCommand

This commit is contained in:
2023-01-31 16:07:53 +02:00
parent 22f2cd4e59
commit 4f18f505f4
12 changed files with 299 additions and 342 deletions

View File

@@ -1,12 +1,16 @@
using System;
using PluginManager.Others;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace DiscordBot
{
public class Entry
{
internal static StartupArguments startupArguments;
[STAThread]
public static void Main(string[] args)
{
@@ -22,7 +26,16 @@ namespace DiscordBot
return assembly;
}
Program.Startup(args);
Task.Run(async () => {
if (!File.Exists(Functions.dataFolder + "loader.json"))
{
startupArguments = new StartupArguments();
await Functions.SaveToJsonFile(Functions.dataFolder + "loader.json", startupArguments);
}
else
startupArguments = await Functions.ConvertFromJson<StartupArguments>(Functions.dataFolder + "loader.json");
}).Wait();
Program.Startup(args.Concat(startupArguments.runArgs.Split(' ')).ToArray());
}
}