コード例 #1
0
        public HypixelSkybot(ISocketMessageChannel channel, JToken user)
        {
            _channel    = channel;
            _skyblockId = user["profile_id"].Value <string>();
            if (_timer == null)
            {
                _timer           = new Timer(30000);
                _timer.AutoReset = true;
                _timer.Elapsed  += (sender, eventArgs) => TimerTick();
                _timer.Start();
            }

            var profile = Hypixel.SkyblockProfile(_skyblockId);

            foreach (var member in profile["profile"]["members"])
            {
                var uuid     = member.Name();
                var username = Minecraft.UuidToUsername(uuid).Last["name"].Value <string>();
                _users.Add(new ProfileUser(_channel, uuid, username));
            }

            TimerTick();
        }