Updated ICommandAction.cs and DBEvent.cs. Removed thread request from DBEvent and added special thread request to ICommandAction.cs

This commit is contained in:
2024-07-22 19:20:17 +03:00
parent 08c5febd66
commit 8c338820c5
42 changed files with 691 additions and 26 deletions

View File

@@ -5,8 +5,9 @@ using System.Linq;
using System.Reflection;
using DiscordBot.Utilities;
using DiscordBotCore;
using DiscordBotCore.Modules;
using DiscordBotCore.Others;
namespace DiscordBot;
@@ -80,13 +81,17 @@ public static class Entry
static Assembly LoadFromSameFolder(object sender, ResolveEventArgs args)
{
string requestingAssembly = args.RequestingAssembly?.GetName().Name;
var folderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, $"Libraries/{requestingAssembly}");
var assemblyPath = Path.Combine(folderPath, new AssemblyName(args.Name).Name + ".dll");
if (!File.Exists(assemblyPath))
return null;
var assembly = Assembly.LoadFrom(assemblyPath);
return assembly;
var folderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, $"Libraries/{requestingAssembly}");
var assemblyName = new AssemblyName(args.Name).Name + ".dll";
var assemblyPath = Path.Combine(folderPath, assemblyName);
if (File.Exists(assemblyPath))
{
var fileAssembly = Assembly.LoadFrom(assemblyPath);
return fileAssembly;
}
return null;
}
Program.Startup(args).Wait();