Ejemplo n.º 1
0
        public async Task <string> RunAsync(string user, IMatch game, string[] args)
        {
            DecksiteApi.Deck run;
            try
            {
                run = await DecksiteApi.GetRunAsync(user);
            }
            catch (WebException)
            {
                return("Error contacting PDM website.");
            }
            if (run == null)
            {
                return($"You do not have an active deck in {DecksiteApi.CurrentLeagueName()}.");
            }
            var res = await run.RetireAsync();

            if (res)
            {
                return($"Your deck {run.Name} has been retired from the {run.CompetitionName}");
            }
            else
            {
                return($"Unable to retire your deck.  Please message Katelyn on discord.");
            }
        }
Ejemplo n.º 2
0
        public async Task RetireAsync()
        {
            var person = await API.DecksiteApi.GetPersonAsync(Context.User.Id.ToString());

            if (string.IsNullOrEmpty(person.Name))
            {
                await ReplyAsync("I don't know who you are.  Please message me on MTGO, or https://pennydreadfulmagic.com/link your account first.");

                return;
            }
            var run = await DecksiteApi.GetRunAsync(person.Name);

            if (run == null)
            {
                await ReplyAsync($"You do not have an active deck in {DecksiteApi.CurrentLeagueName()}.");

                return;
            }

            var res = await run.RetireAsync();

            if (res)
            {
                await ReplyAsync($"Your deck {run.Name} has been retired from the {run.CompetitionName}");
            }
            else
            {
                await ReplyAsync($"Unable to retire your deck.  Please message Katelyn on discord.");
            }
        }
Ejemplo n.º 3
0
 public async Task <string> RunAsync(string player, IMatch game, string[] args)
 {
     DecksiteApi.Deck run;
     try
     {
         run = await DecksiteApi.GetRunAsync(player);
     }
     catch (WebException)
     {
         return("Error contacting PDM website.");
     }
     if (run == null)
     {
         return($"You do not have an active deck in {DecksiteApi.CurrentLeagueName()}.");
     }
     return($"Your deck '{run.Name}' is currently {run.Wins}-{run.Losses}");
 }