コード例 #1
0
 public void TestBuggedCards()
 {
     BuggedCards.CheckForNewList();
     Assert.Positive(BuggedCards.Bugs.Count);
     Assert.NotNull(BuggedCards.Bugs.First().CardName);
     Assert.NotNull(BuggedCards.Bugs.First().Classification);
     Assert.NotNull(BuggedCards.Bugs.First().Description);
     Assert.NotNull(BuggedCards.Bugs.First().LastConfirmed);
 }
コード例 #2
0
        public async Task StillBuggedAsync([Remainder] string CardName)
        {
            await Context.Channel.TriggerTypingAsync();

            var person = await API.DecksiteApi.GetPersonAsync(Context.User.Id.ToString());

            var name = person.Name ?? Context.User.Username;

            var(success, message) = await BuggedCards.UpdateBuggedAsync(CardName, name, -1, false);
            await ReplyAsync(message);
        }
コード例 #3
0
        private static async Task RespondToScryfallWithBuggedCardsAsync(SocketMessage arg)
        {
            var match = Regex.Match(arg.Content, @"^https://scryfall.com/card/(\w+)/(\w+)/(?<name>[\w-%]+)");

            if (match.Success)
            {
                var card = Scryfall.GetCard(match.Groups["name"].Value);
                var bug  = BuggedCards.IsCardBugged(card.FullName) ?? BuggedCards.IsCardBugged(card.Names[0]);
                if (bug != null)
                {
                    await arg.Channel.SendMessageAsync($":beetle: {card.FullName} is bugged in MTGO: {bug.Description}");
                }
            }
        }