public MainWindow() { // Load the Keys SecretKeys keys = SecretKeys.Load("Secret.txt"); // Create the Bot Bot = new KellyHoshiraBot(keys); Bot.OnMessageReceived += Bot_OnMessageReceived; Bot.OnLogReceived += Bot_OnLogReceived; Bot.NetworkChanged += Bot_NetworkChanged; // Initialize the Program InitializeComponent(); }
public async Task MainAsync() { // Load the Secret Keys SecretKeys keys = SecretKeys.Load("Secret.txt"); // Create the Bot Bot = new KellyHoshiraBot(keys); await Bot.InitializeAsync(); Bot.OnMessageReceived += Bot_OnMessageReceived; Bot.OnLogReceived += Bot_OnLogReceived; await Bot.ConnectAsync(); await Task.Delay(-1); }