public override void RunCommand(Shard shard, ITextChannel channel, string[] commandParams) { if (commandParams.Length < 2) { SendHelpMessage(channel); } YoutubeChannel yt = manager.GetChannelByChannelID(commandParams[1]); if (yt != null) { yt.GetLatestVideo(); yt.TellVideo(channel); } else { DiscordUtil.SendMessage(channel, "No channel found with ID " + commandParams[1]); } }
public void LoadChannels() { channels.Clear(); String[] channelsString = File.ReadAllLines("channels_yt.json"); String channelStringConcat = ""; foreach (String s in channelsString) { channelStringConcat += s; } JArray channelArray = JArray.Parse(channelStringConcat); for (int i = 0; i < channelArray.Count; i++) { JObject userJO = (JObject)channelArray[i]; channels.Add(YoutubeChannel.FromJson(userJO)); } }
public void AddChannel(YoutubeChannel channel) { channels.Add(channel); SaveChannels(); }
public void AddChannel(String youtubeID) { YoutubeChannel channel = new YoutubeChannel(youtubeID); AddChannel(channel); }