public async void Process(TwitchClient client, string username, string commandText, bool isMod, JoinedChannel joinedChannel) { bool response; if (commandText.Equals("very", StringComparison.OrdinalIgnoreCase)) { response = await _playlistApiClient.VeryClosePlaylist(); } else { response = await _playlistApiClient.ClosePlaylist(); } client.SendMessage(joinedChannel, response ? $"Hey @{username}, I have closed the playlist{(commandText.Equals("very", StringComparison.OrdinalIgnoreCase) ? " completely" : string.Empty)}!" : $"Hey {username}, I can't seem to close the playlist for some reason :("); }
public IActionResult VeryClosePlaylist() { if (!CheckAndSetUserModStatus()) { return(BadRequest()); } try { if (_playlistApiClient.VeryClosePlaylist().Result) { return(Ok()); } return(BadRequest()); } catch (Exception e) { _logger.LogError(e, $"Error in {HttpContext.Request.RouteValues["action"]}"); return(BadRequest()); } }