Пример #1
0
 public static void InitializePlugins(List <Plugin> pluginList, DiscordCoreEvents discordCoreEvents)
 {
     foreach (var plugin in pluginList)
     {
         plugin.Instance.Initalize(discordCoreEvents);
     }
 }
Пример #2
0
        public void Start()
        {
            DiscordSocketClient _client = new DiscordSocketClient();

            // Register the DLL resolver
            AppDomain.CurrentDomain.AssemblyResolve += PluginHelper.ResolveAssembly;
            _client.LoginAsync(TokenType.Bot, apiToken).Wait();
            _client.StartAsync().Wait();
            DiscordCoreEvents events = DiscordCoreEventsFactory.Create(_client);

            Reload();
            pluginList = PluginHelper.LoadPlugins(pluginConfigList);
            PluginHelper.InitializePlugins(pluginList, events);
            PluginHelper.StartPlugins(pluginList);
        }