public async Task HandleGameChange(int delay) { if (_botGames.Count == 0) { return; } await _client.SetGameAsync(_botGames[_random.Next(_botGames.Count)]); await Task.Delay(delay); }
public string GetReactionOrNull(string prompt) { var possibleReacts = _reactions.Where(x => x.Prompt.ToLower() == prompt); //If there's no direct react we can check if it contains & AnywhereInSentence is true if (possibleReacts.Count() == 0) { possibleReacts = _reactions.Where(x => prompt.Contains(x.Prompt.ToLower()) && x.Anywhere); } //If there's still noting return null if (possibleReacts.Count() == 0) { return(null); } var returnString = possibleReacts.ElementAt(_random.Next(possibleReacts.Count())).React; return(returnString); }