Beispiel #1
0
        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]);
            }
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 public void AddChannel(YoutubeChannel channel)
 {
     channels.Add(channel);
     SaveChannels();
 }
Beispiel #4
0
        public void AddChannel(String youtubeID)
        {
            YoutubeChannel channel = new YoutubeChannel(youtubeID);

            AddChannel(channel);
        }