public async Task ScavengeInfoAsync(ScavengeLocation location) { var output = new StringBuilder(); var itemsDict = Item.GetItems(); foreach ((int itemId, Item item) in itemsDict) { if (item.ScavengeLocation == location) { output.AppendLine($"`[{itemId:000}]` {item.Name}"); } } await ReplyAsync(embed : new EmbedBuilder() .WithColor(GetColor(Context)) .WithDescription(output.ToString()) .WithTitle($"Scavenge Location Info: {location}") .Build()); }
public async Task ScavengeStartAsync(MarbleBotUser user, ScavengeLocation location) { if ((DateTime.UtcNow - user.LastScavenge).TotalHours < 6) { DateTime sixHoursAgo = DateTime.UtcNow.AddHours(-6); await SendErrorAsync($"**{Context.User.Username}**, you need to wait for {GetTimeSpanSentence(user.LastScavenge - sixHoursAgo)} until you can scavenge again."); } else { if (_gamesService.Scavenges.ContainsKey(Context.User.Id)) { await SendErrorAsync($"**{Context.User.Username}**, you are already scavenging!"); } else { var scavengeMessage = await ReplyAsync(embed : new EmbedBuilder() .WithColor(GetColor(Context)) .WithDescription($"**{Context.User.Username}** has begun scavenging in **{location.ToString().CamelToTitleCase()}**!") .WithTitle("Item Scavenge Begin!").Build()); _gamesService.Scavenges.GetOrAdd(Context.User.Id, new Scavenge(Context, _gamesService, _randomService, location, scavengeMessage)); } } }