public async Task AddItem([Remainder] string item) { var account = EntityConverter.ConvertUser(Context.User); var inv = account.Inv; var shop = ItemDatabase.GetShop(); if (!shop.HasItem(item)) { var embed = new EmbedBuilder(); embed.WithDescription(":x: Sorry, but we're out of stock for that. Come back later, okay?"); embed.WithThumbnailUrl(ItemDatabase.shopkeeper); embed.WithColor(Colors.Get("Error")); _ = Context.Channel.SendMessageAsync("", false, embed.Build()); return; } if (inv.Buy(item)) { UserAccountProvider.StoreUser(account); _ = ShowInventory(); } else { var embed = new EmbedBuilder(); embed.WithDescription(":x: Balance not enough or Inventory at full capacity."); embed.WithColor(Colors.Get("Error")); _ = Context.Channel.SendMessageAsync("", false, embed.Build()); } await Task.CompletedTask; }
public async Task Shop() { var shop = ItemDatabase.GetShop(); var embed = new EmbedBuilder(); embed.WithColor(new Color(66, 45, 45)); embed.WithThumbnailUrl(ItemDatabase.shopkeeper); embed.AddField("Shop:", shop.InventoryToString(Inventory.Detail.NameAndPrice), true); var fb = new EmbedFooterBuilder(); fb.WithText($"{ItemDatabase.restockMessage} {ItemDatabase.TimeToNextReset.ToString(@"hh\h\ mm\m")}"); embed.WithFooter(fb); await Context.Channel.SendMessageAsync("", false, embed.Build()); }
public async Task Shop() { var shop = ItemDatabase.GetShop(); var embed = new EmbedBuilder(); embed.WithColor(new Color(66, 45, 45)); embed.WithThumbnailUrl(ItemDatabase.shopkeeper); if (DateTime.Now.Date >= new DateTime(day: 1, month: 3, year: 2021) && DateTime.Now.Date < new DateTime(day: 15, month: 3, year: 2021)) { embed.WithDescription("It's the Tolbi market! Up until March 14th you'll get a chance to find more and rarer gear! With this many, the stalls are rotated every 6 hours!"); } embed.AddField("Shop:", shop.InventoryToString(Detail.NameAndPrice), true); var fb = new EmbedFooterBuilder(); fb.WithText($"{ItemDatabase.restockMessage} {ItemDatabase.TimeToNextReset:hh\\h\\ mm\\m}"); embed.WithFooter(fb); await Context.Channel.SendMessageAsync("", false, embed.Build()); }
private Embed GetShopEmbed() { var shop = ItemDatabase.GetShop(); var embed = new EmbedBuilder(); embed.WithColor(new Color(66, 45, 45)); embed.WithThumbnailUrl(ItemDatabase.Shopkeeper); //if (DateTime.Now.Date >= new DateTime(day: 1, month: 3, year: 2021) && // DateTime.Now.Date < new DateTime(day: 15, month: 3, year: 2021)) //{ // embed.WithDescription("It's the Tolbi market! Up until March 14th you'll get a chance to find more and rarer gear! With this many, the stalls are rotated every 6 hours!"); //} embed.AddField("Shop:", shop.InventoryToString(Detail.NameAndPrice), true); var fb = new EmbedFooterBuilder(); fb.WithText($"{ItemDatabase.RestockMessage} {ItemDatabase.TimeToNextReset:hh\\h\\ mm\\m}"); embed.WithFooter(fb); return(embed.Build()); }
public async Task AddItem([Remainder] string item) { var account = UserAccounts.GetAccount(Context.User); var inv = account.Inv; var shop = ItemDatabase.GetShop(); if (!shop.HasItem(item)) { var embed = new EmbedBuilder(); embed.WithDescription(":x: Sorry, but we're out of stock for that. Come back later, okay?"); embed.WithThumbnailUrl(ItemDatabase.shopkeeper); embed.WithColor(Colors.Get("Error")); await Context.Channel.SendMessageAsync("", false, embed.Build()); return; } if (inv.Buy(item)) { _ = ShowInventory(); if (ItemDatabase.GetItem(item).IsArtifact) { account.ServerStats.SpentMoneyOnArtifacts += ItemDatabase.GetItem(item).Price; if (account.ServerStats.SpentMoneyOnArtifacts >= 18000) { await GoldenSun.AwardClassSeries("Crusader Series", (SocketGuildUser)Context.User, (SocketTextChannel)Context.Channel); } } } else { var embed = new EmbedBuilder(); embed.WithDescription(":x: Balance not enough or Inventory at full capacity."); embed.WithColor(Colors.Get("Error")); await Context.Channel.SendMessageAsync("", false, embed.Build()); } }