private async Task QuitHandler(IRC.TwitchChatter chatter, string[] remainingCommand)
        {
            if (chatter.User.AuthorizationLevel < AuthorizationLevel.Admin)
            {
                communication.SendPublicChatMessage($"You are not authorized to disconnect me, @{chatter.User.TwitchUserName}.");
                return;
            }

            communication.SendPublicChatMessage($"Alright @{chatter.User.TwitchUserName}, I'm heading out. Goodbye!");
            await Task.Delay(2000);

            applicationManagement.TriggerExit();
        }
Beispiel #2
0
        private async void HandleKeysLoop()
        {
            while (true)
            {
                Console.CursorVisible = false;
                ConsoleKeyInfo input = await consoleChannel.Reader.ReadAsync();

                if (input.Key == ConsoleKey.Q && ((input.Modifiers & ConsoleModifiers.Control) != 0))
                {
                    applicationManagement.TriggerExit();
                }
            }
        }
 public IActionResult Quit(
     [FromServices] ApplicationManagement applicationManagement)
 {
     applicationManagement.TriggerExit();
     return(Ok());
 }