-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
41 lines (37 loc) · 1.22 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.ComponentModel;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
using VFatumbot.Discord;
namespace VFatumbot
{
public class Program
{
public static void Main(string[] args)
{
#if RELEASE_PROD // no dev version yet
//// Run Discord bot
//DispatchWorkerThread((object sender, DoWorkEventArgs e) =>
//{
// new DiscordBot().RunBotAsync().GetAwaiter().GetResult();
//});
#endif
// Run all other bots on the Bot Framework
CreateWebHostBuilder(args).Build().Run();
}
public static void DispatchWorkerThread(DoWorkEventHandler handler)
{
var backgroundWorker = new BackgroundWorker();
backgroundWorker.DoWork += handler;
backgroundWorker.RunWorkerAsync();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureLogging((logging) =>
{
logging.AddDebug();
logging.AddConsole();
})
.UseStartup<Startup>();
}
}