示例#1
0
        public static void Watch(ISocketMessageChannel channel, string[] args)
        {
            if (args.Length <= 0)
            {
                channel.SendMessageAsync($"Please provide a username to watch a profile for.");
                return;
            }
            var uuid      = Minecraft.UsernameToUuid(args[0])["id"].Value <string>();
            var jProfiles = Hypixel.Player(uuid)["player"]["stats"]["SkyBlock"]["profiles"];

            var profiles = new Dictionary <string, string>();
            var options  = new List <string>();

            foreach (var prof in jProfiles)
            {
                var i    = profiles.Count + 1;
                var p    = prof.First();
                var id   = p["profile_id"].Value <string>();
                var name = p["cute_name"].Value <string>();
                profiles.Add(name, id);
                options.Add(name);
            }

            channel.SendMultipleChoiceAsync("These are the profiles i found", options, option =>
            {
                profiles.TryGetValue(option, out var id);
                var profile = Hypixel.SkyblockProfile(id)["profile"];
                HypixelSkybot.Create(channel, profile);
                channel.SendMessageAsync("Im now watching " + option + " in this channel");
            });
        }