public async void Process(TwitchClient client, string username, string commandText, bool isMod, JoinedChannel joinedChannel) { var success = await _playlistApiClient.ArchiveCurrentRequest(); if (success) { client.SendMessage(joinedChannel, $"Hey @{username}, the current request has been removed"); return; } client.SendMessage(joinedChannel, $"Hey @{username}, I can't seem to do that right now, please try again in a sec"); }
public async Task <IActionResult> RemoveCurrentSong([FromBody] string songId) { if (User.Identity.IsAuthenticated) { if (_modService.IsUserModerator(User.Identity.Name)) { try { await _playlistApiClient.ArchiveCurrentRequest(int.Parse(songId)); return(Ok()); } catch (Exception) { return(Json(new { Success = false, Message = "Encountered an error, or you are not a moderator" })); } } } return(Json(new { Success = false, Message = "Encountered an error, or you are not a moderator" })); }