private static void SkillCommand(ISocketMessageChannel channel, LevelType levelType) { if (!HypixelSkybot.TryGet(channel, out var skybot)) { channel.SendMessageAsync("Im not watching a profile in this channel yet, use !watch first"); } else { var sb = new StringBuilder(); foreach (var profile in skybot) { var level = profile[levelType]; sb.Append(profile.Username); sb.Append(" is "); sb.Append(levelType.ToString().ToLower()); sb.Append(" level "); sb.Append(level.CurrentLevel.ToString()); sb.Append(" with "); sb.Append(level.Xp); sb.Append("/"); sb.Append(level.XpForLevelup); sb.AppendLine("xp."); } channel.SendMessageAsync(sb.ToString()); } }
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"); }); }
public static void Deaths(ISocketMessageChannel channel, string[] args) { if (!HypixelSkybot.TryGet(channel, out var skybot)) { channel.SendMessageAsync("Im not watching a profile in this channel yet, use !watch first"); } else { var sb = new StringBuilder(); foreach (var profile in skybot) { sb.Append(profile.Username); sb.Append(" has a total of "); sb.Append(profile.GetCurrentStat(ProfileUser.Deaths)); sb.AppendLine(" deaths."); } channel.SendMessageAsync(sb.ToString()); } }
public static void UnWatch(ISocketMessageChannel channel, string[] args) { HypixelSkybot.Remove(channel); channel.SendMessageAsync($"Ok i will shut up now :("); }
public static bool TryGet(ISocketMessageChannel channel, out HypixelSkybot skybot) { return(_skybots.TryGetValue(channel.Id, out skybot)); }