Ejemplo n.º 1
0
 public async Task Me()
 {
     try
     {
         WoTUser WoTUserObj     = new WoTUser(Context.Message.Author.Id, Context);
         var     PlayersData    = WoTUserObj.WoTPlayerPersonalData["data"][WoTUserObj.WoTID.ToString()];
         string  PlayerTreesCut = PlayersData["statistics"]["trees_cut"].ToString();
         string  PlayerNickname = PlayersData["nickname"].ToString();
         Context.Message.Channel.SendMessageAsync("Hello " + PlayerNickname + ", you have cut down " + PlayerTreesCut + " trees!");
     }
     catch (ArgumentException)
     {
         Context.Message.Channel.SendMessageAsync("You need to register yourself with the &add command. See &help for usage details.");
     }
 }
Ejemplo n.º 2
0
        public async Task Tanks([Remainder, Summary("The text to echo")] string tier)
        {
            if (Int32.TryParse(tier, out int RequestedTier))
            {
                WoTUser WoTUserObj = new WoTUser(Context.Message.Author.Id, Context);
                await Context.Message.Channel.SendMessageAsync(WoTUserObj.WoTPlayerPersonalData["data"][WoTUserObj.WoTID.ToString()]["nickname"] + "'s tier " + RequestedTier + " tank mastery:");

                string outputmessage = string.Join("\n", WoTUserObj.TanksUserMastery(RequestedTier));
                await Context.Message.Channel.SendMessageAsync(outputmessage);
            }
            else
            {
                Context.Message.Channel.SendMessageAsync("Command usage: &tanks <tier>");
            }
        }
Ejemplo n.º 3
0
 public async Task Add([Remainder, Summary("The player's WoT name.")] string Nickname)
 {
     try
     {
         WoTUser UserObj = new WoTUser(Context.Message.Author, Nickname);
         await Context.Message.Channel.SendMessageAsync("Done!");
     }
     catch (ArgumentOutOfRangeException)
     {
         await Context.Message.Channel.SendMessageAsync($"Failed! Seems like \"{Nickname}\" doesn't exist :(");
     }
     catch (Exception e)
     {
         await Context.Message.Channel.SendMessageAsync(e.Message);
     }
 }
Ejemplo n.º 4
0
        public async Task Sig()
        {
            try
            {
                WoTUser WoTUserObj = new WoTUser(Context.Message.Author.Id, Context);
                string  Filename   = "Users/" + WoTUserObj.WoTID + ".png";
                using (WebClient wc = new WebClient())
                {
                    wc.DownloadFile("http://wotlabs.net/sig_cust/FFFFFF/36393E/eu/" + WoTUserObj.WoTPlayerPersonalData["data"][WoTUserObj.WoTID.ToString()]["nickname"].ToString() + "/signature.png", Filename);
                    await Context.Message.Channel.SendFileAsync(Filename);

                    File.Delete(Filename);
                }
            }
            catch (ArgumentException)
            {
                await Context.Message.Channel.SendMessageAsync("You need to register yourself with the &add command. See &help for usage details.");
            }
        }